Search code examples
seleniumselenium-webdriverautomationselenium-chromedriversaucelabs

Sleeping time range when using sauce lab driver?


I am using sauce Lab driver for my selenium test cases. In one of my test case, I need to have the process to take 1 minute sleep, before continuing the rest steps. And I have seen much higher % of random failure for this case, with the message such as:

The test with session id ... has already finished, and can't receive further commands...

Was that because it takes too much time to run, and the session timed-out by sauce-lab ?

Usually I have tens of test cases running in one single-thread way, and every test class handles the driver by itself, such as:

public class TestASuite extends TestBase { 
    @BeforeClass(alwaysRun=true)
    public void setup(...) {
        // driver starts here... 
    }
    @AfterClass(alwaysRun = true)
    public void closeSession(ITestContext test) {
        // driver ends here 
    }
    public void testCase1(){}
    ....
}

Solution

  • You have to change your sauce lab config for handling such timeouts. Please refer this to understand how things work. SauceLab Selenium Timeouts

    commandTimeout is the param actually, you are looking for and need to change.