I am using Selenium RC with Java using TestNG as Test Framework. I'm using Eclipse as IDE. I want to invoke TestNG from my own program very easily. How can I do that?
My following code in java works nicely:
@Test
public void testTestNGProgramatically(){
TestListenerAdapter tla = new TestListenerAdapter();
TestNG testng = new TestNG();
testng.setTestClasses(new Class[] {LoginAuthentication.class, GmailSigninSignout.class});
testng.addListener(tla);
testng.run();
}
You can get the details explanation by visiting the following URL:
http://testng.org/doc/documentation-main.html#running-testng-programmatically