【发布时间】:2016-05-10 02:27:14
【问题描述】:
我正在尝试自动化一个将其内容加载到 web 视图的电子应用程序。我正在使用 spectron 和 webdriverio。
这是我正在使用的代码。
it('should assess webview', function() {
var self = this;
return this.app.client.waitUntilWindowLoaded()
.windowHandles().then(function(session) {
self.app.client.switchTab(session.value[1])
.click("#my-id")
.then(console.log.bind(console))
.catch(console.log.bind(console));
});
});
这似乎不起作用。我不确定我哪里出错了。但是我用过
it('should assess webview', function() {
var self = this;
return this.app.client.waitUntilWindowLoaded()
.windowHandles().then(function(session) {
self.app.client.switchTab(session.value[1])
.getSource()
.then(console.log.bind(console))
.catch(console.log.bind(console));
});
});
以上代码确保webview窗口句柄是否正确。它是。请帮忙。谢谢
【问题讨论】:
标签: webdriver electron webdriver-io