phpunit-selenium icon indicating copy to clipboard operation
phpunit-selenium copied to clipboard

Unexpected exception during findElement thrown when locating an element

Open glennhoward opened this issue 11 years ago • 1 comments

When you have an element with an id that begins with a numeric:

<section id="3boxes">...<section>

And you try and locate the above element using:

$boxesSection = $this->byCssSelector('#3boxes');

The following error is thrown:

17:09:02.979 INFO - Executing: [find element: By.selector: section#3boxes] at URL: /session/ce7425ff-baf9-4068-a9ce-6690314ee67b/element)
17:09:04.552 ERROR - Unexpected exception during findElement
org.openqa.selenium.WebDriverException: An invalid or illegal string was specified
Command duration or timeout: 192 milliseconds
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'localhost.localdomain', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-431.3.1.el6.x86_64', java.version: '1.7.0_45'
Session ID: ba22fefd-1a9a-40cd-aeef-2310ff036a9f
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=LINUX, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, browserConnectionEnabled=true, webStorageEnabled=true, nativeEvents=false, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=24.2.0}]

This isn't a bug in selenium as I was able to find the element without error when using the java bindings.

glennhoward avatar Jan 15 '14 10:01 glennhoward

It can be a driver in the remote web driver implementation, since it seems the exception is thrown in the Java process. The comparison could be made by trying RemoteWebDriver from Java to see if it reproduces.

giorgiosironi avatar Jan 26 '14 16:01 giorgiosironi