In testng.xml, I have included couple of test classes for grouping. Inside Test Classes I pass some parameters and group name:
@Parameters({"excelName", "excelTabName"})
@BeforeClass(alwaysRun=true)
public void setup(){/*Setup code here*/}
@Test(groups={"security"})
public void searchUser() {/*Test code here*/}
If I disable all the test class names apart from one which I would like to run, I use maven command like mvn -Dgroup=groupName test. It fires up the test class which is not commented in testng.xml
I would like to keep all those test classes enabled in testng.xml and still would like to run only one test when required. Any suggestions would be very much appreciated.
Looks like all you need, is to specify which methods to execute when running
This will load only the test method
searchUser()for execution.