Issue 2978 in selenium: Weird failure causing null to be returned to the test script on findElement

2 views
Skip to first unread message

sele...@googlecode.com

unread,
Dec 1, 2011, 12:17:42 PM12/1/11
to selenium-deve...@googlegroups.com
Status: Accepted
Owner: p...@hammant.org
Labels: Type-Defect Priority-Medium

New issue 2978 by p...@hammant.org: Weird failure causing null to be
returned to the test script on findElement
http://code.google.com/p/selenium/issues/detail?id=2978

This is in release 2.13, using Firefox 3.6.x, and for test scripts that
normally work...

java.lang.reflect.UndeclaredThrowableException
at $Proxy3.findElement(Unknown Source)
at
org.openqa.selenium.remote.server.handler.FindChildElement.call(FindChildElement.java:45)
at
org.openqa.selenium.remote.server.handler.FindChildElement.call(FindChildElement.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.openqa.selenium.remote.server.KnownElements$1.invoke(KnownElements.java:62)
... 8 more
Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate
element: {"method":"id","selector":"Out1B"}; duration or timeout: 16
milliseconds
For documentation on this error, please visit:
http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.13.0', revision: '14793', time: '2011-11-18
13:16:47'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.version: '1.6.0_27'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:147)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:113)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:416)
at
org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:231)
at
org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:154)
at
org.openqa.selenium.remote.RemoteWebElement.findElementById(RemoteWebElement.java:167)
at org.openqa.selenium.By$ById.findElement(By.java:210)
at
org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:150)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement$1.invoke(EventFiringWebDriver.java:325)
at $Proxy2.findElement(Unknown Source)
at
org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.findElement(EventFiringWebDriver.java:396)
... 13 more
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException:
Unable to locate element: {"method":"id","selector":"Out1B"}
Build info: version: '2.13.0', revision: '14793', time: '2011-11-18
13:16:47'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.version: '1.6.0_27'
Driver info: driver.version: unknown
at <anonymous
class>.WebDriverError(file:///C:/DOCUME~1/chef/LOCALS~1/Temp/anonymous205717793146120166webdriver-profile/extensions/fxdr...@googlecode.com/resource/modules/utils.js:8959)
at <anonymous class>.<anonymous
method>(file:///C:/DOCUME~1/chef/LOCALS~1/Temp/anonymous205717793146120166webdriver-profile/extensions/fxdr...@googlecode.com/components/driver-component.js
->
file:///C:/DOCUME~1/chef/LOCALS~1/Temp/anonymous205717793146120166webdriver-profile/extensions/fxdr...@googlecode.com/components/firefoxDriver.js:401)
at <anonymous class>.<anonymous
method>(file:///C:/DOCUME~1/chef/LOCALS~1/Temp/anonymous205717793146120166webdriver-profile/extensions/fxdr...@googlecode.com/components/driver-component.js
->
file:///C:/DOCUME~1/chef/LOCALS~1/Temp/anonymous205717793146120166webdriver-profile/extensions/fxdr...@googlecode.com/components/firefoxDriver.js:441)
at <anonymous class>.<anonymous
method>(file:///C:/DOCUME~1/chef/LOCALS~1/Temp/anonymous205717793146120166webdriver-profile/extensions/fxdr...@googlecode.com/resource/modules/utils.js:266)
at <anonymous class>.<anonymous
method>(file:///C:/DOCUME~1/chef/LOCALS~1/Temp/anonymous205717793146120166webdriver-profile/extensions/fxdr...@googlecode.com/components/nsCommandProcessor.js:306)
at <anonymous class>.<anonymous
method>(file:///C:/DOCUME~1/chef/LOCALS~1/Temp/anonymous205717793146120166webdriver-profile/extensions/fxdr...@googlecode.com/components/nsCommandProcessor.js:320)
at <anonymous class>.<anonymous
method>(file:///C:/DOCUME~1/chef/LOCALS~1/Temp/anonymous205717793146120166webdriver-profile/extensions/fxdr...@googlecode.com/components/nsCommandProcessor.js:197)

sele...@googlecode.com

unread,
Dec 6, 2011, 11:29:15 AM12/6/11
to selenium-deve...@googlegroups.com
Updates:
Cc: dawa...@gmail.com
Labels: Component-WebDriver

Comment #1 on issue 2978 by dawa...@gmail.com: Weird failure causing null

to be returned to the test script on findElement
http://code.google.com/p/selenium/issues/detail?id=2978

Could you supply a reproduceable test-case (by whatever means is convenient
for you) for this bug, and details of where this log message came from?

I suspect what is going on is:

* RemoteWebDriver being used
* Child element being looked up isn't present
* Remote driver throws

We have some tests for this, which show that the actual exception thrown
*is* the NoSuchElementException as expected, but the RemoteWebDriver server
logs this slightly uglier mess, because it does so before the exception
translation happens.

I've attached a fix for this, which makes the correct exception be logged,
and keeps the correct exception being thrown; if my guesses above aren't
correct, a reproduceable test case would help make the issue more
concrete :)

Attachments:
2978.patch 1.1 KB

sele...@googlecode.com

unread,
Dec 6, 2011, 3:39:12 PM12/6/11
to selenium-deve...@googlegroups.com
Updates:
Labels: Browser-Firefox Lang-Java

Comment #2 on issue 2978 by barancev: Weird failure causing null to be

returned to the test script on findElement
http://code.google.com/p/selenium/issues/detail?id=2978

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages