How to stop TestNg from running the test methods in a Class separately

Skip to first unread message

Deepak Gopal

Nov 18, 2022, 12:13:58 AM11/18/22
to testng-users

I use Testng version "6.14.3" as a Maven Dependency in my project. My testng.xml uses groups to identify testcases to run in the given classes.
I have recently ran into a problem where TestNg is running the TestMethods in a given class separately, because of which the second set of the tests which have a dependency on one of the tests from the first set are failing.
 I want to stop testNg from doing this. Is there a configuration to make sure TestNG executes all the tests in the given class, which are filtered based on the selected Group in TestNG.xml before it moves to the next class?

This is how its setup:
Groups = "Sanity"
Classes = "TestUsers", "TestManagers"
Methods = TestUsersMethod1, TestUserMethod2(DependOn=TestUsersMethod1), TestUserMethod3(DependsOn=TestUsersMethod1)

Run looks like this:
- TestNG Suite
---- Automation
------------TestManagerMethod1 (Passed)

The information contained in this e-mail and any attachments to this message are intended for the exclusive use of the intended recipient and may contain proprietary, confidential or legally privileged information. If you are not the intended recipient, please note that you are not authorised to disseminate, distribute or copy this e-mail or any parts of it or act upon/rely on the contents of this e-mail in any manner. Please notify the sender immediately by e-mail and destroy all copies of this e-mail and any attachments.

⇜Krishnan Mahadevan⇝

Nov 18, 2022, 12:16:06 AM11/18/22
Please retry using :
  • TestNG v7.6.1 - If you are on JDK11
  • TestNG v7.5 - If you can't use JDK11 yet and can use ONLY JDK8
If the problem persists, please help share a sample that can be used to reproduce the problem along with the necessary suite file and also details on how you are running the tests (Surefire plugin settings etc.,)

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @
My Technical Scribblings @

You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages