public class XmlMainClass {
@Test
public static void main(String[] args) {
// Create object of TestNG Class
TestNG runner=new TestNG();
// Create a list of String
List<String> suitefiles=new ArrayList<String>();
// Add xml file which you have to execute
suitefiles.add("Path of your XML File");
// now set xml file for execution
runner.setTestSuites(suitefiles);
// finally execute the runner using run method
runner.run();
}
}
Regards,
Raju
Guys, anyone having idea on how to execute a simple java (main) class before a testng suite file starts executing during Maven Test phase
--
Mahesh,
Don't have a working example, but you may setup maven exec plugin to execute your main in pre-test phase
YB