Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium 使用沙司实验室驱动程序时的睡眠时间范围?_Selenium_Selenium Webdriver_Automation_Selenium Chromedriver_Saucelabs - Fatal编程技术网

Selenium 使用沙司实验室驱动程序时的睡眠时间范围?

Selenium 使用沙司实验室驱动程序时的睡眠时间范围?,selenium,selenium-webdriver,automation,selenium-chromedriver,saucelabs,Selenium,Selenium Webdriver,Automation,Selenium Chromedriver,Saucelabs,我正在为我的selenium测试用例使用sauce Lab驱动程序。在我的一个测试用例中,我需要先进行1分钟的睡眠,然后再继续其他步骤。我发现,在这种情况下,随机失效的比例要高得多,其信息如下: public class TestASuite extends TestBase { @BeforeClass(alwaysRun=true) public void setup(...) { // driver starts here... } @A

我正在为我的selenium测试用例使用sauce Lab驱动程序。在我的一个测试用例中,我需要先进行1分钟的睡眠,然后再继续其他步骤。我发现,在这种情况下,随机失效的比例要高得多,其信息如下:

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(){}
    ....
}
会话id为的测试。。。已完成,无法接收更多命令…

这是因为运行时间太长,而且会话由sauce lab超时吗

通常我有几十个测试用例以一个线程的方式运行,每个测试类自己处理驱动程序,例如:

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(){}
    ....
}

您必须更改您的酱汁实验室配置以处理此类超时。 请参考这篇文章来了解事情是如何运作的。


commandTimeout
实际上是参数,您正在查找并需要更改。

谢谢。是否有一种方法可以动态调整sauceLab超时值?我可能只有两个案例需要更长的一个,但我找不到可以遵循的示例。这些应该是文档中所述的功能的一部分。此外,这些是超时,根据超时功能,如果在时间之前满足预期,则不会延迟执行。