Forum: Ruby Watir question

5dfc843f9ecf6fb64b52a35bdce43910?d=identicon&s=25 Raja gopalan (arc)
on 2014-06-11 09:02
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
14b5582046b4e7b24ab69b7886a35868?d=identicon&s=25 Joel Pearson (virtuoso)
on 2014-06-11 18:08
b.elements.each { |el| puts el.tag_name }
5dfc843f9ecf6fb64b52a35bdce43910?d=identicon&s=25 Raja gopalan (arc)
on 2014-06-12 08:48
Joel Pearson wrote in post #1149516:
> b.elements.each { |el| puts el.tag_name }

Thank you.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.