Is there any possibility to execute jar file having selenium tests described in testng xml file through command Prompt -
when write script in bat file following code project location actual testng file placed:
set projectlocation=c:\users\automation-master cd %projectlocation% set classpath=%projectlocation%\bin;%projectlocation%\seleniumlibrary\* java org.testng.testng %projectlocation%\testng.xml
with above code browser invoked.
but in same way need execute jar(of above project) file comprising of class files, libs , testng xml actual tests in through command line.
my query how specify classpath of libs , classes in jar file , point testng xml file in jar execute script?
assuming have built jar contains test classes, can specify in testng via below options
-testjar
- specifies jar file contains test classes. if testng.xml file found @ root of jar file, used, otherwise, test classes found in jar file considered test classes.-xmlpathinjar
- attribute should contain path valid xml file inside test jar (e.g.resources/testng.xml
). defaulttestng.xml
, means file calledtestng.xml
@ root of jar file. option ignored unless-testjar
specified.
see here more information.
Comments
Post a Comment