10

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?

Alexei Vinogradov
  • 1,078
  • 1
  • 13
  • 29

1 Answers1

11

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);
    })
siegy22
  • 3,897
  • 1
  • 18
  • 39
lacy
  • 428
  • 3
  • 11