1 回答

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超4個(gè)贊
使用并行 Dataprovider
@DataProvider(parallel = true)
public Object[][] listToArrays() {
List<String> list = new ArrayList();
list.add("1");
list.add("2");
list.add("3");
list.add("4");
Object[][] array = new Object[list.size()][1];
for (int i = 0; i < list.size(); i++) {
array[i][0] = list.get(i);
}
return array;
}
@Test(dataProvider = "listToArrays")
public void test(String s) {
System.out.println(s + " " + Thread.currentThread().getId());
//do your test with s
}
ps 不知道上下文,但是感覺你做的不對(duì)
添加回答
舉報(bào)