我试图从主套件文件中运行套件但是当我运行TestNG套件时,没有任何事情发生,因为套件永远不会启动。
如果我运行mozilla套件运行正常,但是当我运行Chrome套件时,我得到以下错误。任何帮助将不胜感激。
主人套房
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Chrome Test Suite" verbose="1">
<suite-files>
<suite-file path="./CAR_MozillaTestSuite.xml"></suite-file>
<suite-file path="./CAR_ChromeTestSuite.xml"></suite-file></suite-file>
</suite-files>
</suite>
CAR_MozillaTestSuite.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Mozilla Test Suite">
<parameter name="browser" value="Mozilla" />
<parameter name="domain" value="Caribbean" />
<listeners>
<listener class-name="utils.Listener"></listener>
</listeners>
<test name="Mozilla Test" preserve-order="true">
<classes>
<class name="tests.common.LoginLogout_Test" />
</classes>
</test>
</suite>
CAR_ChromeSuiteTest
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Chrome Test Suite">
<parameter name="browser" value="Chrome" />
<parameter name="domain" value="Caribbean" />
<listeners>
<listener class-name="utils.Listener"></listener>
</listeners>
<test name="Chrome Test" preserve-order="true" >
<classes>
<!-- ______________________________________________ JOBSEEKER SECTION ____________________________________________ -->
<class name="tests.common.LoginLogout_Test"/>
</classes>
</test>
</suite>
运行主镶嵌套件
时出错About to begin executing test Chrome Test
About to begin executing LoginLogout_Test.beforeMethod
Feb 26, 2016 12:24:11 PM org.openqa.selenium.os.UnixProcess checkForError
SEVERE: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "C:\workspace\IJ_Stash\src\main\resources\drivers\chromedriver.exe" (in directory "."): CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher)
答案 0 :(得分:0)
更改xml文件的路径。点表示当前文件夹。 如果主套件也位于与src / test / java / suites相同的文件夹中,那么使用 ./CAR_MozillaTestSuite.xml
顺便说一句,您应该将套件文件放在src / test / resources中,而不是java文件夹中。