被测应用程序在每次页面加载后都会发出“页面加载”事件,我想在页面成功加载后截屏。尝试使用 Leadfoot 的 execute 方法监听此事件。但这似乎不起作用。谁能指出是否有办法成功监听页面加载等事件。
return remote.get(URL)
.execute(function() {
window.addEventListener('page-load', function() {
console.log("Page ready");
}, false);
}, [])
.takeScreenshot().then(function(data) {
recordImage(newAddress, data);
})