开发者社区> 问答> 正文

在selenium java POM项目中不使用testng.xml文件且仅使用pom.xml文件是

如何仅使用pom.xml文件执行不带testng.xml文件的Testng和Maven

展开
收起
垚tutu 2019-11-29 23:00:22 1000 0
1 条回答
写回答
取消 提交回答
  • #include

    不,只能通过Maven 无法执行基于Testng的测试套件,即不使用只能pom.xml使用testng.xml。

    您需要配置的Maven即pom.xml与所需的testng.xml文件作为强制配置如下:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.17</version>
        <configuration>
            <suiteXmlFiles>
                <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
            </suiteXmlFiles>
        </configuration>
    </plugin>
    
    2019-11-29 23:00:37
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载