我正在Selenium网格上使用Surefire插件执行测试运行Selenium测试。 在我的测试细分方面,我有几个班级,其中一些班级有一个测试,并有一个以上的测试。JUnit和Surefire并行测试 - ForkCount和ThreadCount
所以在我的网格上我有30个chrome web驱动程序,我想在所有类中并行执行所有测试。
我读过如何使用parallel
参数,我已经设置为做到这一点:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<includes>
<include>${testSuite}</include>
</includes>
<parallel>all</parallel>
<useSystemClassLoader>false</useSystemClassLoader>
<perCoreThreadCount>false</perCoreThreadCount>
<threadCount>20</threadCount>
<browser>${browser_type}</browser>
</configuration>
</plugin>
然而,这似乎不填写的所有Chrome网络驱动器我有可用。
如果我再使用forkCount
,如:
<forkCount>20</forkCount>
<reuseForks>true</reuseForks>
然后,当测试执行第一次启动时,所有的网络驱动程序,但是它充满很快开始下降和行为一次一个。
所以我的问题:
- 有forkCount和THREADCOUNT
- 之间的关系有什么额外的,我需要做才能真正获得并行运行这个?
谢谢。
是否使用@NotThreadSafe在你的测试?你需要的一切在这里https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html –
没有 - 没有使用@NotThreadSafe – userMod2
硒脚本旨在平行运行?否则所有线程操作都将在单个浏览器中发生。 – parishodak