A link cannot be found using the name attribute. #42

Closed
s2k opened this Issue Aug 22, 2012 · 0 comments

Projects

None yet

2 participants

@s2k
s2k commented Aug 22, 2012

Context

Win XP box, Ruby 1.9.2p290
gem list watir # => watir (3.0.0) watir-classic (3.1.0)
gem list sinatra # => sinatra (1.3.3)

Behaviour

Given a rather simplistic web site as this:

  require "sinatra"
  get '/' do
    "<a href='http://example.com/' name='a_name' >Click me!</a>"
  end

When I run the sinatra app on the default port (4567) and…

Then, in a command line, I try to use the link via the name attribute I get an exception:

j:…>pry -r watir
[1] pry(main)> b = Watir::Browser.new
=> #<Watir::IE:0x1538fd32 url="about:blank" title="">
[2] pry(main)> b.goto "http://localhost:4567/"
=> 0.203129
[3] pry(main)> b.link( name: 'a_name' ).flash
Watir::Exception::MissingWayOfFindingObjectException: name is an unknown way of finding a <a> element (a_name)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/locator.rb:76:in `rescue in match?'

Expectation

Further remarks

@jarmo jarmo closed this in bd128a9 Oct 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment