Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access element with custom attribute using Watir?

I have HTML that looks like this:

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

I would like to enter text in it using Watir.

like image 976
Željko Filipin Avatar asked Dec 18 '22 05:12

Željko Filipin


1 Answers

Filipin's answer did not work for my job with watir-webdriver.

I did, however, find a way to do the job with css selectors.

browser.element(:css, "input[custom_attribute='so cool']").send_keys("the coolest")
like image 66
boulder_ruby Avatar answered Feb 20 '23 09:02

boulder_ruby