tags:

views:

81

answers:

3

In our application we have some input tags with the following attrbutes:

<INPUT class=input-time id=Projects-Projects_Project_0_Task_0_EntryHours_0>

I have tried most of the watir input methods but nothing works to recognize this object. Can anyone shed a little light for me?

My watir version is 1.6.5.

A: 

Summary page at Watir wiki links to a few pages with a lot of useful data. Take a look at How and What, HTML Elements Supported by Watir and Ways Available To Identify HTML Element.

Examples (tested on Mac OS 10.6 with firewatir 1.6.6.rc1):

browser.text_field(:id => "Projects-Projects_Project_0_Task_0_EntryHours_0").set "test"
browser.text_field(:id => /Project_0/).set "test"
browser.text_field(:class => "input-time").set "test"
Željko Filipin
Thanks to everyone. I'm still pretty new to both Ruby and Watir, so I didn't think about doing it that way!
TheMarmosetKing
+1  A: 

Hi,

browser.text_field(:id => /Project_0/).set "test"

If the above code is not working then please try

browser.text_field(:id => /Project_0/).value="test"

Thanks Raveendran P

jazzezravi
+1  A: 

browser.text_field(:id => /EntryHours/i).set "test"

rajiv