Željko Filipin's Blog on Software and Testing

Test like you do not need the money.

Archive for January, 2007

Watir: Select Element Using Custom Attribute

without comments

Paul Rogers and Prema Arya just started a very interesting thread at wtr-general.

If you have text field

<input custom_attribute="so cool" type="text" />

you can get value of custom_attribute

browser.text_field(:index, 1).attribute_value("custom_attribute")
#=> "so cool"

and you can set value of that text field using custom_attribute

browser.text_field(:xpath , "//input[@custom_attribute='so cool']/").set("even more cool")

Written by Željko Filipin

January 29th, 2007 at 5:56 pm

Posted in Watir

Tagged with