Finding elements inside of iFrames 26/07/2012
# Finding the frame first
frame = browser.frame(:id => '<iframe_id>') 

# Finding a link inside of the frame
element = => '<link_id>')

When accessing page elements in iframes, one needs to use the reference to the frame and then find elements inside of it with the usual watir-webdriver syntax. The element inside of the frame could be anything but a link is used in this example.

Retrieving all links on a page 26/07/2012
# all links

# all links with the CSS class of navigation
browser.links(:class => 'navigation')

Retrieving multiple elements is as simple as using the plural form of the element name. Similar qualifiers as when searching for a single element can be used.

Finding a link with title 26/07/2012 => "<link title>")

A link can be found with multiple methods. Sometimes using the title attribute is a good way to find it.

Clicking on a link 26/07/2012 => '<id>').click

Page elements to be actioned upon need to be found first. In this example, a link found by specifying an ID after which it is clicked with the click method.

Finding a link with id 26/07/2012 => 'link_id')

A link can be found with several methods. This tip shows how to find a link by specifying an ID.