Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

saving HTML source code for debugging in nightwatch.js

Suppose, I have a failing test in only one of the browsers, where one of the css/html elements is "not found".

Screenshot looks okay. How can I get the html source of the current document to check?

like image 279
Alexei Vinogradov Avatar asked Sep 08 '14 21:09

Alexei Vinogradov


1 Answers

Using Nightwatch's wrapper for selenium function source (DOC), this can be accomplished relatively easily.

For instance:

browser
    .url("http://www.google.com")
    .source((result) => {
        // Source will be stored in result.value
        console.log(result.value);
    })
like image 89
lacy Avatar answered Nov 13 '22 22:11

lacy