Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

My code structure is like this:

I have four classes having ten tests and one @BeforeClass method to run before any of the tests. In each of four classes all tests are of one single group.

And I have one another class which I need to run before that @BeforeClass method in four of the tests.

How do I achieve that? Please help me.

share|improve this question

1 Answer 1

And I have one another class which I need to run before that @BeforeClass method in four of the tests.

To achieve this you can try to do this: Just make all of the four class extend this "AnotherClass" and add @BeforeClass annotation in the constructor of this class.

Hope this will help.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.