I wanted to trigger the execution from a java main method instead of testng.xml file.
My doubt is how to add the parameters to Java main method for the execution. I have found .addListener and .setGroups to add listener and groups respectively, but couldn't able to find a way to add parameters.
Please help me out to start the exection through java main method.
Sample:
public class Execution {
public static void main(String[] args) throws IOException {
TestNG test = new TestNG();
test.setTestClasses(new Class[] {AETVTests.class});
test.addListener(new MyTestListenerAdapter());
test.setGroups("");
test.run();
}
}