我想从Jenkins UI运行一个或多个testng.xml文件中列出的测试用例。
在我的testng文件中只有三个测试用例,我已在不同的操作系统和浏览器中分发。
下面是testng.xml代码
<!-- Chrome_Browser on Mac OS -->
<test name="ChromeMacTestcase1" preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Mac OS X 10.9" />
<classes>
<class name="com.testCases.Testcase1">
</class>
</classes>
</test>
<test name="ChromeMacTestcase2"
preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Mac OS X 10.9" />
<classes>
<class name="com.testCases.Testcase2">
</class>
</classes>
</test>
<test name="ChromeMacTestcase3"
preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Mac OS X 10.9" />
<classes>
<class name="com.testCases.Testcase3">
</class>
</classes>
</test>
<!-- Chrome_Browser on Windows OS -->
<test name="ChromeWinTestcase1" preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Windows 10" />
<classes>
<class name="com.testCases.Testcase1">
</class>
</classes>
</test>
<test name="ChromeWinTestcase2"
preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Windows 10" />
<classes>
<class name="com.testCases.Testcase2">
</class>
</classes>
</test>
<test name="ChromeWinTestcase3"
preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Windows 10" />
<classes>
<class name="com.testCases.Testcase3">
</class>
</classes>
</test>
<!-- Firfox_Browser on Mac OS -->
<test name="FirefoxMacTestcase1" preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Mac OS X 10.9" />
<classes>
<class name="com.testCases.Testcase1">
</class>
</classes>
</test>
<test name="FirefoxMacTestcase2"
preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Mac OS X 10.9" />
<classes>
<class name="com.testCases.Testcase2">
</class>
</classes>
</test>
<test name="FirefoxMacTestcase3"
preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Mac OS X 10.9" />
<classes>
<class name="com.testCases.Testcase3">
</class>
</classes>
</test>
<!-- Firefox_Browser on Windows OS -->
<test name="FirefoxWinTestcase1" preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Windows 10" />
<classes>
<class name="com.testCases.Testcase1">
</class>
</classes>
</test>
<test name="FirefoxWinTestcase2"
preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Windows 10" />
<classes>
<class name="com.testCases.Testcase2">
</class>
</classes>
</test>
<test name="FirefoxWinTestcase3"
preserve-order="true">
<parameter name="browser" value="chrome" />
<parameter name="version" value="54" />
<parameter name="platform" value="Windows 10" />
<classes>
<class name="com.testCases.Testcase3">
</class>
</classes>
</test>
基本上我想从jenkins UI执行以下操作。
如何将这些参数从Jenkins传递到testng.xml并根据Jenkins UI中的选定选项运行测试用例?