I have the following testNg XML file. I would like to run Test1 and not Test2. How can I do it? I tried excluding the methods of Test2 using the "exclude" keyword. But it doesn't seem to work that. I cannot make changes to the actual code. Unfortunately, that is forbidden. All I can do is make changes to this XML and run the tests. Is there any way using which I can ignore Test2 while still manage to run Test1? I am looking for a more elegant way than commenting the code out.
<?xml version="1.0" encoding="UTF-8"?>
<suite name="Suite" parallel="false">
<parameter name="xxx" value="yyy" />
<parameter name="zzz" value="aaa" />
<parameter name="user" value="1" />
<test name="Test1">
<parameter name="browser" value="Chrome" />
<define name = "regression">
<include name = "spot" />
<include name = "sanity" />
</define>
<groups>
<run>
<include name="regression" />
</run>
</groups>
<classes>
<class name="class2" />
<method>
<include name="method1" />
<include name="method2" />
</method>
</classes>
</test>
<test name="Test2">
<parameter name="browser" value="Firefox" />
<define name = "regression">
<include name = "spot" />
<include name = "sanity" />
</define>
<groups>
<run>
<include name="spot" />
<exclude name="sanity" />
</run>
</groups>
<classes>
<class name="class2" />
<method>
<include name="method1" />
<include name="method2" />
</method>
</classes>
</test>
</suite> <!-- Suite -->