1

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?

Krishnan Mahadevan
  • 14,121
  • 6
  • 34
  • 66
NX-
  • 19
  • 5

1 Answers1

0

The problem has got nothing to do with TestNG.

You are being throttled by SauceLabs.

Quoting the SauceLabs documentation.

Checking Your Concurrency Limit

Each Sauce Labs account has a set maximum number of concurrent sessions. You can find your concurrency limit on the My Account page (at https://saucelabs.com/beta/users/username). If this number does not match your subscription or invoiced contract, please contact Support.

Subaccounts may have had their concurrency limit lowered by their parent account. To access higher concurrency levels, you will need to ask the person responsible for the parent account to increase your limit.

For more information, please refer to the below documentation on SauceLabs portal.

  1. Why am I not getting the parallelism/concurrency I expected?
  2. Understanding Concurrency Limits and Team Accounts
Krishnan Mahadevan
  • 14,121
  • 6
  • 34
  • 66