【发布时间】:2020-03-13 04:06:25
【问题描述】:
我已经在 cucumber 中设置了并行执行测试,以便在可用的 Android 设备上运行并行测试。以下是我执行的步骤。我已经通过参考黄瓜文档https://cucumber.io/docs/guides/parallel-execution/#testng
第 1 步:在我的 TestRunner 类中扩展 AbstractTestNGCucumberTests 类并添加到下面的方法
@Override
@DataProvider(parallel = true)
public Object[][] scenarios() {
return super.scenarios();
}
第 2 步:在 pom.xml 中,我在配置标签内添加了以下参数
<parallel>methods</parallel>
<threadCount>4</threadCount>
例如,如果有 5 个测试用例要运行,当我尝试从 pom.xml/TestRunner 类文件中执行时。 4 个设备正在启动,只有第一个设备执行一个测试用例。其余的通过抛出 SessionNotCreatedException 失败并且执行停止。
谁能尽快告诉我解决方案?
非常感谢!
如果我以上几点有什么不清楚的地方,请告诉我?
【问题讨论】: