Closed hemanth closed 11 years ago
I don't have any ideas why it works in irb for you :)
You'd also have to call #to_subtype
to convert to Watir::TextField
so you could use #set
.
For example:
@browser.elements(:css=>"input[type=password]").each { |element| element.to_subtype.value = "test"}
However, i would not use #elements
and :css
locators ever since it is the slowest combination possible.
I would use #text_fields
instead:
@browser.text_fields.each { |field| field.value = "test"}
If it is really important to just set value to password
fields, then i'd do like this:
@browser.text_fields.select { |field| field.type == "password" }.each { |field| field.value = "test"}
Why is it a WIN32OLE?