我试图并行运行测试方法。 testNG xml中的并行属性对我的执行没有影响。它们为所有四种可能的选项(方法,测试,类,实例)运行相同的方法.i.e我的方法对于所有四个选项都是顺序调用的,但我需要它们以并行方式运行。从here我明白“方法”选项应该为我工作。任何帮助?TestNG并行属性对方法执行没有影响
TestNG xml如下。
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Test Suite" verbose="1" parallel="methods" thread-count="2">
<test name="parallel">
<classes>
<class name="com.sample.A" />
</classes>
</test>
</suite>
,并且测试类是遵循
package com.sample;
Class A
{
@Test
public void abc() throws Exception
{
// some code here
}
@Test
public void xyz() throws Exception
{
//some code here
}
}
我从来没有使用parallel =方法,因为我从来没有观察到它做任何事情。然而,使用parallel = classes对我来说工作得很好。 – djangofan