You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
What steps will reproduce the problem?
1. Using Selenium Server 2.0b3 (Selenium component, not webdriver), navigate to www.google.com
2. Attempt to click on a link using the locator "css=a:contains('^About Google$')"
What is the expected output? What do you see instead?
Expect: Click on the link "About Google"
Actual: console reports "ERROR: Element css=a:contains('^About Google$') not found"
What version of the product are you using? On what operating system?
selenium-server-standalone-2.0b3 on Windows 7 64-bit.
This issue does not repro (i.e. it works as expected) with selenium-server-1.0.3 on
the same hardware.
Please provide any additional information below.
This is not a widely documented feature of Selenium but I use it quite extensively.
I found out about it via the Sauce Labs blog. See the "Matching by inner text section"
here:
http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/
I use ruby (selenium-client), some simplified code to repro:
page.open('http://www.google.com')
page.click("css=a:contains('^About Google$')")
Note: if you remove the anchors ^ and $ from the locator the code will work, but this
allows for loose rather than exact matching.
Reported by dara.lillis on 2011-04-13 21:44:31
The text was updated successfully, but these errors were encountered:
contains isn't a valid CSS3 selector; because of this several browsers don't natively
support contains, so Selenium (and WebDriver) don't claim to support it.
In Selenium, I believe link='About Google' is what you're looking for, and in WebDriver
driver.find_element(:link_text, 'About Google')
Originally reported on Google Code with ID 1547
Reported by
dara.lillis
on 2011-04-13 21:44:31The text was updated successfully, but these errors were encountered: