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 4 classes having 10 tests and one @BeforeClass method to run before any of the test.In each of 4 classes ,all tests are of one single group.

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

How do I achieve that.Please help

share|improve this question
add comment

1 Answer

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

To achieve:

Just make all of the 4 class extend this "AnotherClass" and add @BeforeClass annotation in the constructor of this class.

Hope this will help.

share|improve this answer
add comment

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.