如何从命令行传递多个suiteXML文件

时间:2013-04-01 21:05:14

标签: maven testng pom.xml

我需要从命令行运行多个XML套件文件。

我的POM.xml -

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.5</version>
    <configuration>
        <suiteXmlFiles>
                <suiteXmlFile>src/test/resources/xml_Suites/${tests}.xml</suiteXmlFile>
        </suiteXmlFiles>
        <testFailureIgnore>true</testFailureIgnore>
    </configuration>
</plugin>

从命令行尝试此操作 -

mvn clean -Dtests={abcd,xyz} test

在未触发abcd.xml时仅触发xyz.xml。

基本上只触发大括号中提到的最后一个xml文件。

上述语法有什么问题吗?

2 个答案:

答案 0 :(得分:2)

我认为您需要使用enitre路径指定 更改-Dtests = src / test / resources / xml_Suites / abcd.xml,src / test / resources / xml_Suites / xyz.xml

答案 1 :(得分:0)

以下Sample为我工作:

mvn test -Dsurefire.suiteXmlFiles=/Users/mdafsarali/repository/path/IOS.xml,/Users/mdafsarali/repository/path/IOS2.xml,/Users/mdafsarali/repository/path/IOS3.xml
相关问题