【发布时间】:2018-09-08 15:18:59
【问题描述】:
在网站上,nightwatch.js demo script已经失效,谷歌更改了搜索引擎结果页面html/css,所以之前的元素访问不起作用。尝试了一些使用元素和 xpath 的新方法,但我还没有找到解决方案。
module.exports = {
'Demo test Google' : function (client) {
client
.url('http://www.google.com')
.waitForElementVisible('body', 1000)
.assert.title('Google')
.assert.visible('input[type=text]')
.setValue('input[type=text]', 'rembrandt van rijn')
.waitForElementVisible('button[name=btnG]', 1000)
.click('button[name=btnG]')
.pause(1000)
.assert.containsText('ol#rso li:first-child',
'Rembrandt - Wikipedia')
.end();
}
};
知道要进行哪些更改才能完全运行测试并返回正确的结果吗?
【问题讨论】:
标签: nightwatch.js