【问题标题】:Selenium via Node.js and webdriverIO: timeout without effectSelenium 通过 Node.js 和 webdriverIO:超时无效
【发布时间】:2015-11-17 01:09:22
【问题描述】:

testfile.js

var webdriverio = require('webdriverio');
var options = {
    desiredCapabilities: {
        browserName: 'firefox'
    }
};

webdriverio
    .remote(options)
    .init()
    .url('http://localhost/proj/index.php')
    .moveToObject('div.media')             // Move to DIV
    .timeouts('implicit',6000)             // Wait...
    .saveScreenshot('./snapshot1.png')     // Take Screenshot
    .end();

.timeouts 无效。无论我选择使用哪个参数调用.timeouts(['scrip'|'implicit'|'page load'], ms).,屏幕截图几乎都是在moveToObject 之后立即截取的。

我也得到与回调函数相同的结果:

.timeouts('implicit',6000).then(function(){
    this.timeouts('implicit',6000)
}

有什么建议吗?

【问题讨论】:

  • 您可能正在寻找pause 而不是timeoutswebdriver.io/api/utility/pause.html
  • 这就是我想要的。谢谢! :D 你能把这个写成答案,这样我就可以接受它是正确的吗?

标签: javascript node.js selenium webdriver-io


【解决方案1】:

要延迟队列执行,请使用 pause 而不是 timeouts

http://webdriver.io/api/utility/pause.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-07
    • 1970-01-01
    • 1970-01-01
    • 2019-06-17
    • 1970-01-01
    • 2019-05-26
    • 2019-12-02
    • 1970-01-01
    相关资源
    最近更新 更多