This is a continuation of Counting the number of HTML elements that have the same attribute in the Vatira question .
So, suppose I have an HTML element as follows
<input type="password" class="foo" /> <span class="foo"></span> <a href='1' class="foo">Text</a>
So, I can get a collection of all elements having the same class name using
elements = browser.elements(:class,"foo")
Since, his collection, I can use each method to iterate through the collection. Iterating over the collection, I want to determine what type of tag is represented? (Something like nodeName or tagName method in Javascript). Is there any way to do this in Vatira?
Code example:
elements = browser.elements(:class,"foo") elements.each { |element| puts element.<Watir_method_similar_to_nodeName_of_JavaScript> }
source share