Using the following XML file, I can run all of the tests in the some.package.login
Java package.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Login">
<test name="Login">
<packages>
<package name="some.package.login"/>
</packages>
</test>
</suite>
I would like to run TestNG from the command line which does the same as the above XML file but without the XML file. (This question is asking how to run with the XML file.) I know about the -suitename
parameter. I just don't know how to limit the execution to a specific package.
I tried -testclass some.package.login.*
but TestNG treats this as a name of a class and doesn't handle wild cards.
I could use -groups
and then use @Test(groups = "Login")
on all of the tests but I would rather not have to do that.
I am looking for a solution which is easier than creating an XML file for each subset of tests I want to run. Writing a class for each subset isn't any easier than writing an XML file.
In case this is not possible to do, I have filed a TestNG enhancement request.