Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't locate by name with nested array #1

Open
napcs opened this issue May 12, 2009 · 0 comments
Open

Can't locate by name with nested array #1

napcs opened this issue May 12, 2009 · 0 comments

Comments

@napcs
Copy link

napcs commented May 12, 2009

Given the site http://www.pastie.org/

and the form field

 <textarea class="pastebox" cols="40" id="paste_body" name="paste[body]" rows="22" tabindex="20"></textarea>

this test fails:

 require 'watir'
 b = Watir::Safari.new
 b.goto "http://www.pastie.org"
 b.text_field(:name, "paste[body]").set "Foo"

You get

Watir::Exception::UnknownObjectException: Unable to locate TextField element with id of paste_name
from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.5/lib/safariwatir/scripter.rb:521:in execute' from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.5/lib/safariwatir/scripter.rb:174:infocus'
from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.5/lib/safariwatir.rb:382:in `set'
from (irb):7

However it works if you address it by id.

 b.text_field(:id, "paste_body").set "Foo"

Although you do see this:

  => :missing_value

and I don't know what that's supposed to mean :)

Started looking through the source code and I had no idea why this wouldn't work. This is still the case with the gem I built today from github (0.3.5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant