gpt4 book ai didi

javascript - Selenium 通过 Node.js 和 webdriverIO : timeout without effect

转载 作者:行者123 更新时间:2023-12-02 15:25:16 25 4
gpt4 key购买 nike

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)
}

有什么建议吗?

最佳答案

要延迟队列执行,请使用暂停而不是超时

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

关于javascript - Selenium 通过 Node.js 和 webdriverIO : timeout without effect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33747502/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com