0

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.

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

You can always save Selenuim tests as JUnit and run them with all your other unit tests in a single suite.

Comments

1

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(); 
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.