Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Failure Details says "null" when it cannot find an Element on self-hosted Selenium Server #43

Open
rmadakasira opened this issue Mar 3, 2015 · 3 comments

Comments

@rmadakasira
Copy link

If a test fails as it cannot find an WebElement, the failure that it returns is null on a self-hosted Selenium Server.

How can I make get the correct Failure and store it ? Appreciate your help. Thanks.

@rmadakasira
Copy link
Author

In this case, the "Execution Status" is always "Running" , and it never goes into "Error" mode. I will have to manually delete the "TestSuiteID" in order to re-execute the test.

@nadeemg
Copy link
Contributor

nadeemg commented Mar 4, 2015

I don't have a setup to test this, but this seems odd because the code that populates the error into a TestExectution is the same no matter what provider is used.

Can you confirm that your self-hosted selenium server is giving the same response as saucelabs when a WebElement isn't found?

This is what I see when a webelement isn't found on saucelabs:

no-such-element

@rmadakasira
Copy link
Author

It looks like my selenium server throws an exception in this case. I see the below stacktrace on my selenium server in this case.

*** Element info: {Using=css selector, value=#Account_Tab > a}
Session ID: af75e95b224350184cb451c7bc3426c7
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browser
Name=chrome, chrome={userDataDir=C:\DOCUME1\ADMINI1\LOCALS~1\Temp\1\scoped_dir
4208_25807}, rotatable=false, locationContextEnabled=true, mobileEmulationEnable
d=false, version=40.0.2214.115, takesHeapSnapshot=true, cssSelectorsEnabled=true
, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, web
StorageEnabled=true, nativeEvents=true, applicationCacheEnabled=false, takesScre
enshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou

rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.
java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHa
ndler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.ja
va:599)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDrive
r.java:352)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(R
emoteWebDriver.java:441)
at org.openqa.selenium.By$ByCssSelector.findElement(By.java:426)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDrive
r.java:344)
at sun.reflect.GeneratedMethodAccessor18.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$2.invoke(Even
tFiringWebDriver.java:101)
at com.sun.proxy.$Proxy1.findElement(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.findElement(E
ventFiringWebDriver.java:184)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElemen
t.java:47)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElemen
t.java:1)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession
.java:168)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
10:44:40.366 WARN - Exception: no such element
(Session info: chrome=40.0.2214.115)
(Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9
cf),platform=Windows NT 5.2 SP2 x86_64) (WARNING: The server did not provide any
stacktrace information)
Command duration or timeout: 30.05 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/
no_such_element.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants