Reputation: 2017
I've came to this problem for quite a few times now.
It appears that Watir won't find the anchor (link) element, when I want to find it by the following syntax:
@browser.link(:text => 'View page directly').click
If I try checking link presence it will say that it doesn't exist, although the link is there.
Here is the link to original source code that causes this behavior: https://dl.dropbox.com/u/3290107/watir-test.xhtml
Why is this happening and how to fix it?
Thanks for help
Upvotes: 1
Views: 451
Reputation: 57262
This looks like a bug to me. You should report it here: https://github.com/watir/watir-webdriver/issues
browser.a(:text => "View page directly").present?
# => false
browser.as[-2].text
# => "View page directly"
browser.as[-2].present?
# => true
Upvotes: 1