Selenium 2.8 UnsatisfiedLinkError IEDriver - selenium

In my main project in IntelliJ I cannot get my selenium tests to run. I've now created a cut-down project that has only the example code from The 5 Minute Getting Started Guide and is using the selenium-server-standalone-2.8.0.jar.
When I run with the FirefoxDriver I have no problems. When I try to run with the IEDriver however, I get the following output:
"C:\Program Files\Java\jdk1.6.0_26\bin\java" -Didea.launcher.port=7534 "-Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 10.0.3\bin" -Dfile.encoding=ISO-8859-1 -classpath "C:\Program Files\Java\jdk1.6.0_26\jre\lib\alt-rt.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\alt-string.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\ext\sunpkcs11.jar;C:\development\playground\selenium\out\production\Selenium Playground;C:\Users\rachel.swailes\Downloads\selenium-server-standalone-2.8.0.jar;C:\Program Files\JetBrains\IntelliJ IDEA 10.0.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain Example
new File(".").getAbsolutePath() = C:\development\playground\selenium\.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.openqa.selenium.ie.InternetExplorerDriver.setup(InternetExplorerDriver.java:84)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:50)
at Example.main(Example.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
Caused by: org.openqa.selenium.WebDriverException: java.lang.UnsatisfiedLinkError: Unable to load library 'IEDriver': com.sun.jna.Native.open(Ljava/lang/String;)J
Build info: version: '2.8.0', revision: '14056', time: '2011-10-06 12:41:26'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_26'
Driver info: driver.version: InternetExplorerDriver
at org.openqa.selenium.ie.InternetExplorerDriverServer.initializeLib(InternetExplorerDriverServer.java:129)
at org.openqa.selenium.ie.InternetExplorerDriverServer.<clinit>(InternetExplorerDriverServer.java:38)
... 8 more
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'IEDriver': com.sun.jna.Native.open(Ljava/lang/String;)J
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:166)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:239)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:393)
at com.sun.jna.Native.loadLibrary(Native.java:378)
at org.openqa.selenium.ie.InternetExplorerDriverServer.initializeLib(InternetExplorerDriverServer.java:125)
... 9 more
Process finished with exit code 1
Now I have traced through the code inside InternetExplorerDriverServer and I can see the IEDriver.dll showing up in a temporary directory, but it cannot load it for some reason.
I am running Windows 7 and IE8 and I have loaded IntelliJ using "Run as Administrator" and I'm just out of ideas at this point. I also don't know if all processes that IntelliJ starts in this mode also have admin privileges or if this is a red herring.
Also, using Dependency Walker on IEDriver.dll I can see that it thinks that IEShims.dll is not linked - but again, I'm not sure what to do with this information.
Can anyone suggest something else for me to try?
[edit]
I've now tried it on XP and I have the same problem so I guess it's not the Windows 7 permissions. It must be something to do with how IntelliJ loads the file. If I copy and paste the execution line into the command line it will run, but it won't run from IntelliJ.
Many thanks,
Rachel

After much digging...
IntelliJ 10.0.3 was adding C:\Program Files\JetBrains\IntelliJ IDEA 10.0.3\bin\..\.\bin; to the path. When I added this to the command line, the application would fail and when I removed it it would pass.
I tried on 10.5 Community Edition and had the same problem, but on 10.5 Ultimate Edition there is no problem. I didn't think that there would be a difference so I didn't upgrade my Ultimate Edition until today.
So in short - the answer was to upgrade IntelliJ. :)

I have same issue with IJ-IC 11.1.4 , had same issue
but you just need to add this dll directory to "vm options" like this
-Djava.library.path=C:\lib

Related

How to solve "Your Firefox profile cannot be loaded. It may be missing or inaccessible" while using Selenium

I want to use selenium with geckodriver. So I have installed firefox and Geckodriver. But when I just run a simple selenium Application I get a dialoge box with the error.
My Code:
public static void main(String[] args) throws MalformedURLException {
System.setProperty("webdriver.gecko.driver", "/usr/bin/geckodriver");
WebDriver driver2 = new FirefoxDriver();
driver2.get("https://google.com");
Selenium Log:
mozrunner::runner INFO Running command: "/usr/bin/firefox" "--marionette" "-no-remote" "-profile" "/tmp/rust_mozprofileBF85Lf"
Exception in thread "main" org.openqa.selenium.WebDriverException:
Process unexpectedly closed with status 1 Build info: version:
'3.141.5', revision: 'd54ebd709a', time: '2018-11-06T11:42:16' System
info: host: 'my-thinkpad', ip: '192.168.100.117', os.name: 'Linux',
os.arch: 'amd64', os.version: '5.15.0-33-generic', java.version:
'13.0.2' Driver info: driver.version: FirefoxDriver
But the main Problem I get as dialogbox:
Your Firefox profile cannot be loaded. It may be missing or
inaccessible.
When I just run the /usr/bin/firefox ... command in terminal without the profile parameter it works. I got the tip from several tutorials to delete the .mozilla directory in my home directory, but there is no .mozilla folder. Im using Kubuntu 22.04. Is there any way to start geckodriver without profile parameter or solve this problem?
Probably the profile gets stored in the directory where there is no permission to write. So, it would obviously fail.
Solution:
enter export TMPDIR=$HOME/Downloads/ geckodriver
In my case, my geckodriver is in Downloads so I exported TMPDIR to the Downloads.
Or try this:
Just move the geckodriver to any other directory where there is permission to write like Downloads or Documents and try the above solution.

My question is that I am getting an error(Timed out waiting for driver server to start for chrome browser)

I am using Eclipse Luna with windows 10-64 bit, selenium-server-standalone-3.141.59 and selenium-java-3.141.59. I have write a simple program to hit the url .But I am getting this error:
[13552:3540:0515/184943.562:ERROR:cache_util_win.cc(21)] Unable to
move the cache: 0
[13552:3540:0515/184943.562:ERROR:cache_util.cc(141)] Unable to move
cache folder C:\Users\RChauh\AppData\Local\Google\Chrome\User
Data\ShaderCache\GPUCache to
C:\Users\RChauh\AppData\Local\Google\Chrome\User
Data\ShaderCache\old_GPUCache_000
[13552:3540:0515/184943.562:ERROR:disk_cache.cc(185)] Unable to create
cache [13552:3540:0515/184943.562:ERROR:shader_disk_cache.cc(623)]
Shader Cache Creation failed: -2 Opening in existing browser session.
Exception in thread "main" org.openqa.selenium.WebDriverException:
Timed out waiting for driver server to start. Build info: version:
'3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System
info: host: 'LAPTOP-3VFBUTNB', ip: '192.168.1.102', os.name: 'Windows
10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_211'
Driver info: driver.version: ChromeDriver at
org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:202)
at
org.openqa.selenium.remote.service.DriverService.start(DriverService.java:188)
at
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at
org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at
org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:181)
at
org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:168)
at
org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:123)
at helloWorld.java.main(java.java:11) Caused by:
org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting
for [http://localhost:32149/status] to be available after 20016 ms at
org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100)
at
org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:197)
... 9 more Caused by: java.util.concurrent.TimeoutException at
java.util.concurrent.FutureTask.get(Unknown Source) at
com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:156)
at
org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75)
... 10 more
package helloWorld;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class java {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");
WebDriver driver=new ChromeDriver();
driver.get("https://www.facebook.com/");
System.out.println("LoginPage");
driver.quit();
}
}
You should set webdriver.chrome.driver property to point to the chromedriver.exe, not to chrome.exe
Download the relevant ChromeDriver package for your Chrome browser version
Unpack the archive somewhere
Amend the webdriver.chrome.driver property to point to the chromedriver.exe from step 2
That's it, you should be good to go now
Check out ChromeDriver - WebDriver for Chrome -> Getting Started for more detailed information if needed.
Until it's not too late be aware of Page Object design pattern, it is some form of Selenium scripting Best Practice which allows to split test logic from UI elements definitions making your tests easier to develop and especially maintain. Check out Design Patterns - Page Object Model for more detailed information and example test project.

Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN10

I am getting following error. Can you advice.
`Exception in thread "main" org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN10
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:32:14.902Z'
System info: host: 'CTSAUS-LT-641', ip: '10.243.111.75', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_172'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:116)
at java.util.Optional.orElseGet(Unknown Source)
at org.openqa.selenium.firefox.FirefoxOptions.getBinary(FirefoxOptions.java:217)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:161)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:103)
at newpackage.MyClass.main(MyClass.java:11)`
Do as error message tells you: Make sure firefox is installed.
Then check out, if it is configured properly, i.e. firefox.exe is in a directory which appears in your PATH environment variable. You can check it out with typing echo %PATH% in your command line.
See where Fiurefox is installed for example by right-clicking on your Firefox desktop icon and then checking "Properties" dialog to see where it is installed.
If for example firefox.exe is in directory "C:\Program Files (x86)\Mozilla Firefox" then this directory has to appear in the (semicolon separated) list of the PATH varaible.

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died with ChromeDriver and Selenium

I'm running a bunch of test cases every hour using selenium-java 3.12.0; TestNG; Selenoid with docker, Jenkins.
Sometimes (about 1 out of 10 cases) I get the error:
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'autotest.rvkernel.com', ip: '94.130.165.217', os.name: 'Linux', os.arch: 'amd64', os.version: '4.13.0-26-generic', java.version: '1.8.0_181'
Driver info: driver.version: RemoteWebDriver
Capabilities [{mobileEmulationEnabled=false, hasTouchScreen=false, platform=LINUX, acceptSslCerts=false, acceptInsecureCerts=false, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=LINUX, setWindowRect=true, unexpectedAlertBehaviour=, applicationCacheEnabled=false, rotatable=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.39.562737 (dba483cee6a5f15e2e2d73df16968ab10b38a2bf), userDataDir=/tmp/.org.chromium.Chromium.gURWcu}, takesHeapSnapshot=true, pageLoadStrategy=normal, unhandledPromptBehavior=, databaseEnabled=false, handlesAlerts=true, version=67.0.3396.62, browserConnectionEnabled=false, nativeEvents=true, locationContextEnabled=true, cssSelectorsEnabled=true}]
Session ID: 56c4b100a95d89b3d5702ec8a1a0698a
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:564)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:276)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement$1.invoke(EventFiringWebDriver.java:376)
at com.sun.proxy.$Proxy14.click(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.click(EventFiringWebDriver.java:389)
at com.Elements.Element.lambda$click$2(Element.java:99)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)
at com.Elements.Element.click(Element.java:98)
at com.Elements.Element.click(Element.java:78)
at com.pages.landing.social.MailRuRegisterPage.clickRegister(MailRuRegisterPage.java:37)
at RulVulaknTests.authorization.AuthorizationTest.authorizationUserFromMailRU(AuthorizationTest.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:571)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:707)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:979)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Cannot decode response content:
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:83)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
... 28 more
Caused by: org.openqa.selenium.json.JsonException: java.io.EOFException: End of input at line 1 column 1 path $
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'autotest.rvkernel.com', ip: '94.130.165.217', os.name: 'Linux', os.arch: 'amd64', os.version: '4.13.0-26-generic', java.version: '1.8.0_181'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.json.JsonInput.execute(JsonInput.java:172)
at org.openqa.selenium.json.JsonInput.peek(JsonInput.java:72)
at org.openqa.selenium.json.JsonTypeCoercer.lambda$null$6(JsonTypeCoercer.java:136)
at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:122)
at org.openqa.selenium.json.Json.toType(Json.java:62)
at org.openqa.selenium.json.Json.toType(Json.java:52)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
... 31 more
Caused by: java.io.EOFException: End of input at line 1 column 1 path $
at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1401)
at com.google.gson.stream.JsonReader.consumeNonExecutePrefix(JsonReader.java:1576)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:534)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
at org.openqa.selenium.json.JsonInput.lambda$peek$0(JsonInput.java:73)
at org.openqa.selenium.json.JsonInput.execute(JsonInput.java:168)
... 37 more
And after this error all remained tests are skipped.
Versions of chrome browser using which I have encountered the error - 66, 67.
This error message...
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
...implies that the RemoteWebDriver instance was closed abruptly.
Your code trials would have been of some help to debug the issue. Perhaps yout main issue can be one of the following:
You have mentioned that you are using selenium-java 3.12.0 but your error trace logs mentions about selenium-java 3.6.0. So possibly there are multiple instances of selenium-java referenced within this project. So you need to ensure that your project is configured with only one set of selenium-java binaries.
As per best practices:
Upgrade Selenium to current levels Version 3.14.0.
Upgrade ChromeDriver to current ChromeDriver v2.41 level.
Keep Chrome version between Chrome v66-68 levels. (as per ChromeDriver v2.41 release notes)
(WindowsOS only) Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
(LinuxOS only) Free Up and Release the Unused/Cached Memory in Ubuntu/Linux Mint before and after the execution of your Test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
As you have mentioned running a bunch of test cases every hour possibly there are multiple dangling instances of ChromeDriver and Chrome which can be viewed through the process list (Linux OS) or TaskManager (Windows OS). You need to always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
If the dangling instances of WebDriver and Web Browser still persists consider killing them with brute force. You can find a detailed discussion in Selenium : How to stop geckodriver process impacting PC memory, without calling driver.quit()?
Incase you program is attempting to set up TCP connections from ports that are greater than 5000 you can refer this article
References
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Getting "Error communicating with the remote browser. It may have died." with chromedriver
IE11: UnreachableBrowserException: Error communicating with the remote browser. It may have died.
WebDriver fix for UnreachableBrowserException
sorry for the reply to very old questions, but thought it could help someone else.
I was facing the same problem, and earlier I also thoughts issue is with Webdriver but it was not the case,
public static final Target EMAIL = Target.the("email")
.locatedBy(("//input[(#id='login-email-input')]"));
And everything was working fine with,
actor.attemptsTo(Enter.keyValues("someemail#gmail.com")
.into(EMAIL).thenHit(Keys.TAB));
but I thought to clear the input box before enter the new value and replaced above line with,
actor.attemptsTo(Clear.field(EMAIL));
actor.attemptsTo(Enter.keyValues("someemail#gmail.com")
.into(EMAIL).thenHit(Keys.TAB));
And I got the same error. After removing newly added line, things started working correctly.

org.openqa.selenium.SessionNotCreatedException: session not created exception

I'm trying to run some Selenium tests using the ChromeDriver, and I started getting this error:
Starting ChromeDriver 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129) on port 42985
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"7576.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.59)
(Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.48 seconds
Build info: version: 'unknown', revision: '2aa21c1', time: '2016-08-02 14:59:43 -0700'
System info: host: 'SUJITH', ip: '192.168.43.228', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:683)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:143)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
at Selenium.Test2.main(Test2.java:15)
Why is this happening, and how can I fix it?
Update your chromedriver with lastest version. And please clarify your question.
https://chromedriver.storage.googleapis.com/index.html?path=2.24/
If your chrome browser is recently updated to V54.0.x, then you might get this error. The solution for this problem is simply to update your chrome driver.
Choose chrome driver from the below link that will suit your system architecture.
Latest Chromedriver v2.25
This issue started showing up after chrome Version 54.0.x updates.
Remove the older chromedriver from your path and update your chromedriver to 2.24. This should resolve your issue.
I had the same issue . Updating the chrome driver solved my problem.
A few things to bare in mind for these type of cases:
Disable browsers auto update - at least on your slaves to avoid these type of breaking your CI process. Link for how to on Chrome, and be sure to watch these settings on the installation.
Versioning is the first thing to check with Selenium when it breaks all of a sudden. See notes for version compatibility.
I'm using my own Maven plugin to check compatibility between chromedriver and Chrome version
Hope it helps...
You might be using the lower version of the chrome driver.
org.openqa.selenium.SessionNotCreatedException: session not created exception
I had the similar issue and was getting the exception as above. So always check the latest version of driver from here: https://sites.google.com/a/chromium.org/chromedriver/downloads
You might need to set in /etc/hosts
127.0.0.1 localhost
In my case the problem was that I kept a Selenium script running for too much time than I run out of disk free space.
So, I just clean out the Temp folder and created a routine to keep cleaning selenium folders, and problem solved.
You will get this error when your code looks like below:
WebDriver driver = new ChromeDriver();
System.setProperty("webdriver.chrome.driver", "C:\\driver\\chromedriver.exe");
You have to setProperty first and then create driver instance next
System.setProperty("webdriver.chrome.driver", "C:\\driver\\chromedriver.exe");
WebDriver driver = new ChromeDriver();