1

The web page I'm testing has a span with inner HTML having a numeric value that I want to extract. For example:

<span class="timeout" style="display:none">5000</span>

I tried using the nightwatch command getText(), but it only returns "displayable" text, which, in this case, is a null string. What is the proper way to access this data?

1 Answer 1

2

Figured it out myself. You can use getAttribute on "innerHTML" to get the value, e.g.,

browser.getAttribute(spanCSS,"innerHTML",function(r)
{   console.log("span's innerHTML is " + r.value)
})

Wonder if there is a list of these "reserved" attribute names somewhere.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.