I understand that when finding by cssSelector, that the Sizzle
JavaScript CSS selector engine is used to locate the element.
My question is can I use sizzle selectors or does it need to be
strictly css selectors that are used.
For example I am trying to do the following:
driver.findElement(By.cssSelector("details.collapsible:contains(\"Server
Side Collapsible - initially collapsed\")"));
In IE I get the error:
Exception in thread "main" org.openqa.selenium.WebDriverException:
Unable to find element with css selector ==
summary.submit:contains("Server Side Collapsible - initially
collapsed") (WARNING: The server did not provide any stacktrace
information)
System info:
os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.version: '1.6.0_11'
In Firefox I get:
Exception in thread "main" org.openqa.selenium.WebDriverException: An
invalid or illegal string was specified
System info:
os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.version: '1.6.0_11'
Is the problem, the usage of the :contains() selector, and why do I
get thast error for Firefox