Watir question

hi,

please have a look at the code below

b.elements.each do |i|
puts i.class
end

In the above coding “puts i.class” prints Watir::Element, but i would
like to know what element it is, like whether it’s a text box, or select
box or check box. So Can I redefine the code in such a way that it would
tell me exactly what element it is?

Raj

b.elements.each { |el| puts el.tag_name }

Joel P. wrote in post #1149516:

b.elements.each { |el| puts el.tag_name }

Thank you.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs