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

问题描述 投票:1回答:2

我需要从命令行运行多个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

仅触发xyz.xml而未触发abcd.xml。

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

以上语法有什么问题吗?

我需要从命令行运行多个XML套件文件。我的POM.xml-maven-surefire-plugin

maven testng pom.xml
2个回答
2
投票

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


0
投票

以下示例为我工作:

© www.soinside.com 2019 - 2024. All rights reserved.