【问题标题】:Sleeping time range when using sauce lab driver?使用酱实验室驱动时的睡眠时间范围?
【发布时间】:2019-01-24 00:13:52
【问题描述】:

我正在为我的 selenium 测试用例使用 sauce Lab 驱动程序。在我的一个测试用例中,在继续其余步骤之前,我需要让该过程进行 1 分钟的睡眠。而且我看到这种情况下随机失败的百分比要高得多,消息如下:

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

是不是因为运行时间太长,并且会话由 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(){}
    ....
}

【问题讨论】:

    标签: selenium selenium-webdriver automation selenium-chromedriver saucelabs


    【解决方案1】:

    您必须更改您的酱汁实验室配置以处理此类超时。 请参考this以了解事情的运作方式。 SauceLab Selenium Timeouts

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

    【讨论】:

    • 谢谢。有没有办法可以即时调整 sauceLab 超时值?我可能只是有几个案例需要更长的案例,但我找不到可以遵循的样本。
    • 这些应该是文档中所述的能力的一部分。
    • 这些也是超时,根据超时功能,如果在时间之前满足预期,它不会延迟您的执行。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-05-26
    • 2018-09-07
    • 1970-01-01
    • 1970-01-01
    • 2019-03-02
    • 2013-05-16
    • 2021-01-01
    相关资源
    最近更新 更多