本文介绍了如何在Maven和Testng中运行并行套件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从Maven并行测试套件.我的pom.xml如下所示:

I want to the Test Suites parallel from maven.my pom.xml looks like below:

<profiles>
        <profile>
            <id>API_AUTOMATION</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.19.1</version>
                        <configuration>
                            <parallel>suites</parallel>
                            <threadCount>8</threadCount>
                            <suiteXmlFiles>
                                <!-- TestNG suite XML files -->
                                <suiteXmlFile>./module1.xml</suiteXmlFile>
                             <suiteXmlFile>./module2.xml</suiteXmlFile>
                            </suiteXmlFiles>
                            <testSourceDirectory>src/main/java</testSourceDirectory>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
</profiles>

所有.xml文件都是TestNG文件,它们是测试套件.请让我知道如何并行运行套件.

all the .xml files are TestNG file which are Test Suites.please let me know, how to run the suites in parallel.

推荐答案

您可以尝试<threadCountSuites>8</threadCountSuites>属性,请勿设置线程数属性或将其设置为0.

You can try with<threadCountSuites>8</threadCountSuites> property and don't set thread count property or set it as 0.

这篇关于如何在Maven和Testng中运行并行套件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-30 05:15