Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

CSS selector :contains doesn't work with Selenium 2.0a7 #987

@lukeis

Description

@lukeis

Originally reported on Google Code with ID 987

What steps will reproduce the problem?
1. just try to retrieve element by css locator and use :contains selector.

Java example:
WebDriver driver = new FirefoxDriver();
driver.get("http://localhost:8080/");
WebElement webElement = driver.findElement(By.cssSelector("a:contains('Text')"));


With FirefoxDriver it throws:
org.openqa.selenium.WebDriverException: An invalid or illegal string was specified

with HtmlUnitDriver it throws:
com.steadystate.css.sac.TestCSSParseException: Error in pseudo class or element. Invalid
token "Text". Was expecting one of: <S>, ")", <IDENT>.


What is the expected output? What do you see instead?
WebElement is found and no Exception threw.


What version of the product are you using? On what operating system?
Selenium 2.0a7


System info: Fedora13, 64b, kernel: '2.6.34.7-61.fc13.x86_64', java.version: '1.6.0_21'.

Reported by rbalent on 2010-11-14 02:07:28

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions