Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Sammy Patel

Greenhorn
+ Follow
since Aug 23, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sammy Patel

Hi Jeanne,

Sorry, if my comments are confusing.  At this point, even I am confused!

Here's the situation:
- The tests are launched
- First test of the first class is executed
- The rest of the tests are skipped
- Control goes on to run the tests of the next class - but in between, the @AfterClass of the previous test class is not executed

So, as I see, there are two issues:
  1.  Why is only the first test of each test class is executed (i.e. the rest of the tests are skipped - not even attempted to be executed)
  2.  Why is @AfterClass method of each test class is not exevuted

Hope this helps....

Regards.
1 year ago
Actually, this is a basic question - why @AfterClass method is not getting executed.  I am not sure about no TestNG user having run into this situation
1 year ago
With the following testNG xml file, I notice that not only the first test of each class is executed AND the @AfterClass method is not executed. After the first test finishes execution, the @BeoreClass of the next test-class is executed.

The execution fails because the @AfterClass method is supposed to clean-up after all tests in the class are executed.  Also, in the test code, I am using @Test(priority=<number>, alwaysRun = true)

Here's the xml file.

1 year ago