假设我只在一个浏览器中进行了测试失败,其中一个css / html元素是"未找到"。
截图看起来没问题。如何获取当前文档的html源代码?
答案 0 :(得分:11)
使用Nightwatch的硒功能包装source
(DOC),这可以相对容易地完成。
例如:
browser
.url("http://www.google.com")
.source((result) => {
// Source will be stored in result.value
console.log(result.value);
})