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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.