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)
}
有什么建议吗?
最佳答案
要延迟队列执行,请使用暂停
而不是超时
关于javascript - Selenium 通过 Node.js 和 webdriverIO : timeout without effect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33747502/