How to run testng test in parallel thread with data driven

瀏覽次數:30 次
跳到第一則未讀訊息

Abhay

未讀,
2020年9月28日 清晨6:20:342020/9/28
收件者:testng-users
I have a testng test, which I need to run on 50 devices simultaneously & test data is stored in excel file.

As of now, it is running sequential manner,  like this - 
1. Read 1st rwo from Excel file (device setup data)
2. Run a deviceSetupTest1
3 Read 2nd row data from Excel file
4.  Run a deviceSetupTest1
It goes on till nth row.

I am looking to run this in parallel. Any suggestion.

Aliasger Kiranawala

未讀,
2020年9月28日 清晨6:25:162020/9/28
收件者:testng-users
You can setup Selenium grid or can use Sauselabs or similar third party who provides virtual devices executions.

Amit Bhoraniya

未讀,
2020年9月28日 清晨7:28:572020/9/28
收件者:testng...@googlegroups.com
Hi Abhay,

You can use data-provider-thread-count property. Below is an example,

<suite name="QAF Demo" verbose="0" data-provider-thread-count="2" parallel="methods">
<test name="Sample Test">
<classes>
<class name="com.infostretch.automation.SampleTest"/>
</classes>
</test>
</suite> And my test class is,
public class SampleTest {

@Test(dataProvider = "SearchProvider")
public void testMethod(String author, String country) {
//your code
}

@DataProvider(name = "SearchProvider")
public Object[][] getDataFromDataprovider() {
return new Object[][]
{
{"Amit", "India"},
{"Kishan", "UK"},
{"Rahul", "USA"}
};

}
}
Thanks, Amit Bhoraniya

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/0aaff981-eab0-40ee-ba59-0ed891deaf59n%40googlegroups.com.
回覆所有人
回覆作者
轉寄
0 則新訊息