I am using the sauce lab for running selenium testNg java script where i have a single @Test method that accepts 250 distinct value from a @dataProvider of TestNG as input. Expected: To spawn 250 browser session parallel in saucelabs and execute the @Test method 250 times parallel. Actual: I can see only a max of 10-12 at a time and remaining sessions follows as the running batch completes.
Please find below my code POM.XML snippet:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<parallel>methods</parallel>
<threadCount>250</threadCount>
<data-provider-thread-count>250</data-provider-thread-count>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration>
</plugin>
DataProvider Code:
@DataProvider(name="SearchData", parallel=true)
public Object[][] GetSearchData() {
//Returning 2D array of Test Data
Object[][] arrayObject = readFromExcel("C:/Test_Workspace/TestData/ICJ-DataProvider.xls","Sheet1");
return arrayObject;
}
@Test(dataProvider = "SearchData")
public void TestE2E(String hocn, String username, String password, Method method)
throws MalformedURLException, InvalidElementStateException, UnexpectedException {
this.createDriver("chrome", "54.0", "Windows 10", method.getName());
WebDriver driver = this.getWebDriver();
Service.visitPage(driver, hocn, username, password);
}
As you can see, I am passing threadCount=250 and data-provider-thread-count=250 from pom.xml. Still it runs as a batch of 10 to complete the 250 data in data provider.
Image showing only 10 instances at a time instead of 250
Can some one please guide me in getting all 250 sessions up at a time?