Friday, April 9, 2010

Collections of HTML Elements: How to collect HTML Elements?

If you have a page that looks like this:
You can get href attribute of all links with:
browser.links.each do |link|
  puts link.href
end
When you execute the code, output should be:
http://google.com/http://facebook.com/
links is not the only collection of HTML elements that Watir supports. For the rest of the collections, take a look at the table on this page.
Watir Method HTML element
areas
buttons
checkboxes
dds

divs
dls

dts



ems
file_fields
forms

?

No comments:

Post a Comment