Reputation: 592
I am able to find elements by class using Watir, but I can't figure out how to do additional processing with them after selection - the elements found are nil (see below).
I would love to see the html text of each element found.
Upvotes: 0
Views: 89
Reputation: 4194
You have instances of Watir::HTMLElement
which at time of definition only stores the parent and selector. The @element
variable which represents the object in the DOM located by Selenium through a browser driver will only be populated when you take an action on the element.
To see the text of each element, just put puts event.text
inside your loop.
Upvotes: 1