Test cases can be run parallel by updating testng.xml.
ex- Here two browsers will open as thread-count = "2" (you can change it according to your requirement). In one browser all the classes will be executed which are under 1st test and in 2nd browser, all the classes will be executed which are under 2nd test.
<suite name="Suite" parallel="tests" thread-count="2">
<test name="Test1">
<classes>
<class name="Library.Module1"/>
</classes>
</test>
<test name="Test2">
<classes>
<class name="Library.Module2"/>
</classes>
</test>
</suite>
Go back to Interview Ques-Ans for Automation Tester
Go to Example with Real Scenario
ex- Here two browsers will open as thread-count = "2" (you can change it according to your requirement). In one browser all the classes will be executed which are under 1st test and in 2nd browser, all the classes will be executed which are under 2nd test.
<suite name="Suite" parallel="tests" thread-count="2">
<test name="Test1">
<classes>
<class name="Library.Module1"/>
</classes>
</test>
<test name="Test2">
<classes>
<class name="Library.Module2"/>
</classes>
</test>
</suite>
Go back to Interview Ques-Ans for Automation Tester
Go to Example with Real Scenario
No comments:
Post a Comment