I have a simple login form that has 2 text fields and a button. I can set the text of the username field just fine. When I set the password field however, the form automatically submits, and I get an error.
From IRB:
irb(main):008:0> ie.text_field(:name, "j_password").set("password")
WIN32OLERuntimeError: unknown property or method `value'
HRESULT error code:0x80070005
Access is denied.
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3431:in `method_missing'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3431:in `doKeyPress'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `each'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `doKeyPress'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3393:in `set'
from (irb):8
irb(main):009:0> ie.text_fields.each {|x| puts x }
type: text
id:
name: j_username
value:
disabled: false
length: 20
read only: false
type: password
id:
name: j_password
value:
disabled: false
length: 20
read only: false
Any ideas why the error, or why the form is being submitted?
Note: I can set the fields just fine without the form being submitted using perl, vbscript, python, autoit, etc.