I would like to call my Selenium tests, written in Java (@Test
annotated) from one class.
Is there option make it class as kind of Test Suite,perhaps annotated appropriately?
thanks.
I would like to call my Selenium tests, written in Java (@Test
annotated) from one class.
Is there option make it class as kind of Test Suite,perhaps annotated appropriately?
thanks.
Yes, there is a way to make Test Suite. You can make and run Test Suite using TestNG of your Selenium Automated Tests as below:
@Test
public void testTestNGProgramatically(){
TestListenerAdapter tla = new TestListenerAdapter();
TestNG testng = new TestNG();
testng.setTestClasses(new Class[] {Test1.class, Test2.class});
testng.addListener(tla);
testng.run();
}
You can always save Selenuim tests as JUnit and run them with all your other unit tests in a single suite.
If you use TestNG then you can programmatically call these test methods, for more on this - http://testng.org/doc/documentation-main.html#running-testng-programmatically