I’m trying to hit a link in a table-row that contains multiple links. This pattern is used throughout the table.
This works:
browser.wait_for(:element => "css=tr:nth-child(1) li:nth-child(2) > a")
This does not:
browser.click "css=tr:nth-child(1) li:nth-child(2) > a"
Any ideas why this might be? I’m using the selenium-client rubygem.
I suspect this is due to a bug in cssQuery, which Selenium currently uses to locate elements by CSS. Details of the issue and a patch can be found in the comments of the following issue: http://jira.openqa.org/browse/SEL-698
Hope that helps – I believe Selenium 2 will be using a different library for CSS locators – possibly JQuery’s Sizzle (http://sizzlejs.com/), which should solve this problem.
Dave.