We can do batch execution in selenium by giving the execution path of testng.xml in batch file. The execution can be triggered through command too (CMD)
At the first step we need to include the classes in the testng.xml file which we want to execute via batch :
After that we need to call the testng.xml file by giving the whole location and creating a .bat file . After giving the following commands in a text file , save it as .bat and execute it :
At the first step we need to include the classes in the testng.xml file which we want to execute via batch :
<suite name="Main Test Suite" verbose="2">
<test name="TestNG Test Group">
<classes>
<class name="com.test.Test1"/>
<class name="com.test.Test2"/>
</classes>
</test>
</suite>
After that we need to call the testng.xml file by giving the whole location and creating a .bat file . After giving the following commands in a text file , save it as .bat and execute it :
cd %pathofProject%
set classpath=%projectLocation%\bin;%projectLocation%\lib\*
java org.testng.TestNG %pathofProject%\testng.xml
pause
No comments:
Post a Comment