0
votes

I Am running my test cases via TestNG runner class,but the problem is when there is only 1 class in runner class all tests are executed correctly. correct execution xml Correct execution XML Whereas if There are more than 1 classes in runner class I get ignored Test cases and suite runs only 1 test cases(method) only from both classes . Incorrect Xml execution Can someone please suggest.

2

2 Answers

0
votes

Try @Test(alwaysRun = true) , For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not beforeGroups): If set to true, this configuration method will be run regardless of what groups it belongs to. For after methods (afterSuite, afterClass, ...): If set to true, this configuration method will be run even if one or more methods invoked previously failed or was skipped.

0
votes

Thanks to Arun I did run some more tests on the same and below solution worked. I had provided same @priority number to different test cases in different test classes, which confused the XML file maybe and it ran only 1 test case from both. I changed sequential priorities like 1-4 then in next class 4-9(5 Tcases).It worked However still not sure why test ng didn't gave any error message for the same and just passed as test cases ignored.