Filipin.eu

Željko Filipin's blog.
Home Blog Tags License

View on GitHub
1 February 2007

Watir: Select Element Using HTML

by Željko Filipin

Bret Pettichord posted this at wtr-general few days ago.

If you have a link that looks like this:

<a href="#" onclick="new Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', {asynchronous:true, evalScripts:true}); return false;">add a term</a>

you can click it using:

browser.link(:html, /contract_id=227/).click
tags: code - ruby