Watir: Select Element Using Custom Attribute
by Željko Filipin
Estimated reading time is 1 minute.
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")Feedback
Thank you for reading. If you want to stay in touch please use the feed or send me an email.