Forum: Ruby Watir question

Cc704ce316e72af824ccd38cfa53104b?d=identicon&s=25 Raja Gopalan (arc)
on 2014-06-11 09:02

please have a look at the code below

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

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?

14b5582046b4e7b24ab69b7886a35868?d=identicon&s=25 Joel Pearson (virtuoso)
on 2014-06-11 18:08
b.elements.each { |el| puts el.tag_name }
Cc704ce316e72af824ccd38cfa53104b?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.