Webdriver: grabHTMLFrom returns array of innerHTML from the set of matched elements #1481
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before 2.0, grabHTMLFrom returned an array of strings with innerHTML of the set of matched elements. After 2.0, it returns the outerHTML of the first element. That it returns the outerHTML is a bug as documentation says that it returns innerHTML and other helpers also return innerHTML.
That it returns an array instead of just the first element is similar to the usage of getHTML of webdriverio, where you have a $(selector).getHTML(false) to return innerHTML for a set of matches. And it is very useful when you need to test multiple elements (e.g. "ul > li"). And if you only need the first result, you can simply use destruction (like "const [html] = await I.grabHTMLFrom(...);" ). Last but not least, an upgrade to 2.0 would not break the grabHTMLFrom function.