session not created: This version of ChromeDriver only supports Chrome version 76 - webdrivermanager-java

receiving the following error session not created: This version of ChromeDriver only supports Chrome version 76
Using latest webdrivermanager version 3.6.2
Seems like it is not finding the latest version of chrome on my machine Version 75.0.3770.142 (Official Build) (64-bit).
code is below, failure is occuring on return statement
WebDriver getDriver() {
WebDriverManager.chromedriver().setup();
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("disable-infobars");
return new ChromeDriver(chromeOptions);
}
org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 76
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'QJ07301311', ip: '10.58.72.245', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_25'
Driver info: driver.version: Driver
remote stacktrace: Backtrace:
Ordinal0 [0x00FF7C93+1473683]
Ordinal0 [0x00F7ADB1+961969]
Ordinal0 [0x00F042E3+475875]
Ordinal0 [0x00E9F365+62309]
Ordinal0 [0x00E9BC77+48247]
Ordinal0 [0x00EB9149+168265]
Ordinal0 [0x00EB8D1D+167197]
Ordinal0 [0x00EB742B+160811]
Ordinal0 [0x00EA0AE6+68326]
Ordinal0 [0x00EA1BF0+72688]
Ordinal0 [0x00EA1B89+72585]
Ordinal0 [0x00F94B77+1067895]
GetHandleVerifier [0x01096875+506677]
GetHandleVerifier [0x01096610+506064]
GetHandleVerifier [0x0109D1B8+533624]
GetHandleVerifier [0x0109704A+508682]
Ordinal0 [0x00F8C266+1032806]
Ordinal0 [0x00F8C0DF+1032415]
Ordinal0 [0x00F96A8B+1075851]
Ordinal0 [0x00F96BF3+1076211]
Ordinal0 [0x00F95BA5+1072037]
BaseThreadInitThunk [0x757F343D+18]
RtlInitializeExceptionChain [0x77DA9802+99]
RtlInitializeExceptionChain [0x77DA97D5+54]

Related

Python Selenium Unable to Locate element by xpath

Hi I am trying to use selenium to make a website bot. Everyone talks about them nowdays and I am curious about how they work. So this is my code:
from selenium import webdriver
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
print("Opening Window")
driver.get("https://store.nvidia.com/de-de/geforce/store/?page=1&limit=9&locale=de-de&search=geforce%20rtx%203060%20ti")
driver.implicitly_wait(5)
button = driver.find_element_by_xpath('/html/body/app-root/product/div[1]/div[1]/div[2]/div/product-details/div/ul/li[1]/ul[1]/div[3]/div[2]/div[2]/button')
driver.implicitly_wait(10)
print("Closing Window")
driver.quit()
I get the error code:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/app-root/product/div[1]/div[1]/div[2]/div/product-details/div/ul/li[1]/ul[1]/div[3]/div[2]/div[2]/button"}
(Session info: chrome=97.0.4692.99)
Stacktrace:
Backtrace:
Ordinal0 [0x00BFFDC3+2555331]
Ordinal0 [0x00B977F1+2127857]
Ordinal0 [0x00A92E08+1060360]
Ordinal0 [0x00ABE49E+1238174]
Ordinal0 [0x00ABE69B+1238683]
Ordinal0 [0x00AE9252+1413714]
Ordinal0 [0x00AD7B54+1342292]
Ordinal0 [0x00AE75FA+1406458]
Ordinal0 [0x00AD7976+1341814]
Ordinal0 [0x00AB36B6+1193654]
Ordinal0 [0x00AB4546+1197382]
GetHandleVerifier [0x00D99622+1619522]
GetHandleVerifier [0x00E4882C+2336844]
GetHandleVerifier [0x00C923E1+541697]
GetHandleVerifier [0x00C91443+537699]
Ordinal0 [0x00B9D18E+2150798]
Ordinal0 [0x00BA1518+2168088]
Ordinal0 [0x00BA1660+2168416]
Ordinal0 [0x00BAB330+2208560]
BaseThreadInitThunk [0x75DEFA29+25]
RtlGetAppContainerNamedObjectPath [0x77307A9E+286]
RtlGetAppContainerNamedObjectPath [0x77307A6E+238]
I do wait 5 seconds for the page to load, but still it can't find xpath. I triplechecked that the xpath was right, and if I search for the xpath in the chrome inspect windows, it can find it.
The problem could be switching the iframe, but the website doesn't use iframes I think. Here is the website URL: https://store.nvidia.com/de-de/geforce/store/?page=1&limit=9&locale=de-de&search=geforce%20rtx%203060%20ti
Selenium looks good.
Your locator is not appropriate so you can use the following one:
1- Absolute xpath:
//html/body/app-root/product/div[1]/div[1]/div[2]/div/product-details/div/div/div/div[3]/div[3]/button
2- Relative xpath:
(//button[#class='compare'])[1]
Note: you can change the value of index depending on which index(button) you want to interact.
3- css-selector:
button[class='compare']

chrome-driver 83 compatibility with Ubuntu

I'm running Ubuntu 18.04.1 LTS and used stable versions of Google Chrome v81 and compatible chrome-driver v81 for a long time successfully.
After reinstalling google-chrome-stable up to 83.0.4103.61 and updating chrome-driver up to 83.0.4103.39. According to the official page they are fully compatible.
But after these updates I'm getting error unable to connect to renderer.
My capabilities remains the same:
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: [
'--headless',
'--disable-gpu',
'--no-sandbox',
'--remote-debugging-port=9222',
'--ignore-certificate-errors',
'--allow-insecure-localhost'
]
}
}
And full error message is the following:
[11:07:05] E/launcher - session not created
from disconnected: unable to connect to renderer
(Session info: headless chrome=83.0.4103.61)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '******', ip: '******', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-38-generic', java.version: '10.0.2'
Driver info: driver.version: unknown
remote stacktrace: #0 0x5633488fb579 <unknown>
My webdriver-manager status:
[11:24:59] I/status - selenium standalone version available: 3.141.59 [last]
[11:24:59] I/status - chromedriver version available: 83.0.4103.39 [last]
[11:24:59] I/status - geckodriver version available: v0.26.0 [last]
[11:24:59] I/status - android-sdk is not present
[11:24:59] I/status - appium is not present
Does anybody faced the same issue and knowing how to solve it or rollback to v81 correctly? Any suggestions will be appreciated.
P.S. 1) the same config works well locally on the latest MacOS 2) I didn't succeed to launch chromium-browser v81 with driver v81, probably did the rollback in a wrong way.
The issue is resolved. The problem was that I was using argument --remote-debugging-port=9222. But someday google-chrome process got stuck deadly and occupied the port. So, when the chromedriver starts the google-chrome it can't get access to busy port for debugging purposes and simply exits with no errors. That's why the chromedriver can't get access to google-chrome and sends unable to connect to renderer error.
The solution is:
kill frozen processes that occupy ports
use debugging-port when you really need it
using direct connection to the chromedriver reduces "layers" so the overall stability was improved

Cannot find Microsoft Edge binary

Try to start a selenium test with the edge driver and get an exception
Everything is working fine with firefox and chrome, but I couldn't manage it to start edge (Version 77.0.223.0 (Official build) dev (64-bit)).
This is my test class
class EdgeTest {
private static String binaryPath;
private WebDriver driver;
#BeforeEach
public void setupTest() {
WebDriverManager.edgedriver().setup();
binaryPath = WebDriverManager.edgedriver().getBinaryPath();
WebDriverManager.edgedriver().browserPath("C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\msedge.exe\")");
System.setProperty("webdriver.edge.driver", binaryPath);
driver = new EdgeDriver();
}
#After
public void teardown() {
if (driver != null) {
driver.quit();
}
}
#Test
public void test() {
// Your test code here. For example:
WebDriverWait wait = new WebDriverWait(driver, 30);
driver.get("https://en.wikipedia.org/wiki/Main_Page");
}
This is the exception I get:
org.openqa.selenium.WebDriverException: unknown error: cannot find Microsoft Edge binary
Build info: version: '3.141.0', revision: '2ecb7d9a', time: '2018-10-31T20:09:30'
System info: host: 'IRVING', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_212'
Driver info: driver.version: EdgeDriver
remote stacktrace: Backtrace:
Ordinal0 [0x00007FF7845DD422+1823778]
Ordinal0 [0x00007FF7845457B2+1202098]
And logs
14:46:46.411 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Edge Dev (based on Chromium) version 77 found
14:46:46.415 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Driver for edge77 not found in local properties
14:46:46.668 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - The driver version for Microsoft Edge 77 is unknown ... trying with latest
14:46:46.669 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Reading https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ to find out the latest version of Edge driver
14:46:47.050 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Latest version of Edge driver is 77.0.229.0
14:46:47.060 [main] INFO io.github.bonigarcia.wdm.Downloader - Using binary driver previously downloaded
14:46:47.060 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Exporting webdriver.edge.driver as C:\Users\cseegraef\.m2\repository\webdriver\edgedriver\win64\x64\77.0.229.0\msedgedriver.exe
Previous : 1.8.0_212-b03
Starting MSEdgeDriver 77.0.229.0 (219d9c8b098bc5511828863cd68c4e880c69814b) on port 46356
Only local connections are allowed.
Please protect ports used by the WebDriver and related test frameworks to prevent access by malicious code.
Thanks for any help or information.

Local functional tests start after more then 1 minute

I have the same tests, the same selenium-server-standalone (2.43.1) and chromedriver (2.10).
I have only functional tests (no unit tests).
My Chrome is at version 37. My OSX is at version 10.9.5. Java version is 1.7.0_51 (Java 7 update 67).
When I run tests a new Chrome instance is opened with an empty tab:
With intern 1.7.0 tests start in less then 10 seconds.
With intern 2.1.1 tests start in 55-60 seconds.
Selenium logs look like this (when run by intern 2.1.1):
01:26:50.195 INFO - Launching a standalone server
01:26:50.388 INFO - Java: Oracle Corporation 24.51-b03
01:26:50.388 INFO - OS: Mac OS X 10.9.5 x86_64
01:26:50.487 INFO - v2.43.1, with Core v2.43.1. Built from revision 5163bce
01:26:50.734 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: MAC
01:26:50.846 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
01:26:50.847 INFO - Version Jetty/5.1.x
01:26:50.850 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
01:26:50.851 INFO - Started HttpContext[/selenium-server,/selenium-server]
01:26:50.851 INFO - Started HttpContext[/,/]
01:26:56.063 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#1f8f110d
01:26:56.064 INFO - Started HttpContext[/wd,/wd]
01:26:56.101 INFO - Started SocketListener on 0.0.0.0:4444
01:26:56.101 INFO - Started org.openqa.jetty.jetty.Server#71a9b093
01:27:24.536 INFO - Executing: [new session: Capabilities [{idle-timeout=60, browserName=chrome, name=tests/intern_local, selenium-version=2.43.1, chromeOptions={args=[test-type]}}]])
01:27:24.592 INFO - Creating a new session for Capabilities [{idle-timeout=60, browserName=chrome, name=tests/intern_local, selenium-version=2.43.1, chromeOptions={args=[test-type]}}]
Starting ChromeDriver (v2.10.267517) on port 32601
Only local connections are allowed.
01:27:26.447 INFO - Done: [new session: Capabilities [{idle-timeout=60, browserName=chrome, name=tests/intern_local, selenium-version=2.43.1, chromeOptions={args=[test-type]}}]]
01:27:26.465 INFO - Executing: [get: about:blank])
01:27:26.865 INFO - Done: [get: about:blank]
01:27:26.875 INFO - Executing: [get location context])
01:27:26.876 INFO - Executing: [take screenshot])
01:27:26.876 INFO - Executing: [get local storage size])
01:27:26.876 INFO - Executing: [doubleclick: no args])
01:27:26.878 INFO - Executing: [execute async script: arguments[0](true);, []])
01:27:27.109 INFO - Done: [take screenshot]
01:27:27.114 INFO - Executing: [Long press: null])
01:27:27.154 INFO - Done: [doubleclick: no args]
01:27:27.158 INFO - Executing: [get window size])
01:27:27.169 INFO - Done: [execute async script: arguments[0](true);, []]
01:27:27.169 WARN - Exception thrown
java.lang.UnsupportedOperationException: Underlying driver does not implement advanced user interactions yet.
at org.openqa.selenium.support.events.EventFiringWebDriver.getTouch(EventFiringWebDriver.java:311)
at org.openqa.selenium.remote.server.handler.interactions.touch.LongPressOnElement.call(LongPressOnElement.java:40)
at org.openqa.selenium.remote.server.handler.interactions.touch.LongPressOnElement.call(LongPressOnElement.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
01:27:27.189 WARN - Exception: Underlying driver does not implement advanced user interactions yet.
01:27:27.205 INFO - Done: [get window size]
01:27:27.212 INFO - Executing: [set window size])
01:27:27.323 INFO - Done: [set window size]
01:27:31.956 WARN - Exception thrown
org.openqa.selenium.WebDriverException: unknown error: Location must be set before it can be retrieved
(Session info: chrome=37.0.2062.124)
(Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.5 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3 milliseconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'
System info: host: 'N/A', ip: 'N/A', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.7.0_51'
Session ID: 25d1fbe63300966edb133612003055d1
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/zx/954mnbfn6s145t6d04g5nr5h0000gq/T/.org.chromium.Chromium.dGVeyG}, rotatable=false, locationContextEnabled=true, version=37.0.2062.124, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:614)
at org.openqa.selenium.remote.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:32)
at org.openqa.selenium.remote.html5.RemoteLocationContext.location(RemoteLocationContext.java:38)
at org.openqa.selenium.chrome.ChromeDriver.location(ChromeDriver.java:195)
at org.openqa.selenium.remote.server.handler.html5.GetLocationContext.call(GetLocationContext.java:31)
at org.openqa.selenium.remote.server.handler.html5.GetLocationContext.call(GetLocationContext.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
01:27:37.029 WARN - Exception thrown
org.openqa.selenium.WebDriverException: unknown error: Runtime.evaluate threw exception: SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
(Session info: chrome=37.0.2062.124)
(Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.5 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 8 milliseconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'
System info: host: 'N/A', ip: 'N/A', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.7.0_51'
Session ID: 25d1fbe63300966edb133612003055d1
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/zx/954mnbfn6s145t6d04g5nr5h0000gq/T/.org.chromium.Chromium.dGVeyG}, rotatable=false, locationContextEnabled=true, version=37.0.2062.124, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:614)
at org.openqa.selenium.remote.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:32)
at org.openqa.selenium.remote.html5.RemoteLocalStorage.size(RemoteLocalStorage.java:72)
at org.openqa.selenium.remote.server.handler.html5.GetLocalStorageSize.call(GetLocalStorageSize.java:30)
at org.openqa.selenium.remote.server.handler.html5.GetLocalStorageSize.call(GetLocalStorageSize.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
01:27:47.173 WARN - Exception: unknown error: Location must be set before it can be retrieved
(Session info: chrome=37.0.2062.124)
(Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.5 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3 milliseconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'
System info: host: 'N/A', ip: 'N/A', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.7.0_51'
Session ID: 25d1fbe63300966edb133612003055d1
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/zx/954mnbfn6s145t6d04g5nr5h0000gq/T/.org.chromium.Chromium.dGVeyG}, rotatable=false, locationContextEnabled=true, version=37.0.2062.124, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
01:27:57.321 WARN - Exception: unknown error: Runtime.evaluate threw exception: SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
(Session info: chrome=37.0.2062.124)
(Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.5 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 8 milliseconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'
System info: host: 'N/A', ip: 'N/A', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.7.0_51'
Session ID: 25d1fbe63300966edb133612003055d1
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/zx/954mnbfn6s145t6d04g5nr5h0000gq/T/.org.chromium.Chromium.dGVeyG}, rotatable=false, locationContextEnabled=true, version=37.0.2062.124, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
01:28:27.773 INFO - Executing: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Ctitle%3Ea%3C%2Ftitle%3E])
01:28:27.794 INFO - Done: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Ctitle%3Ea%3C%2Ftitle%3E]
01:28:27.799 INFO - Executing: [get title])
01:28:27.803 INFO - Done: [get title]
...
My intern configuration looks like:
define({
proxyPort: 9000,
proxyUrl: 'http://localhost:9000/',
capabilities: {
'selenium-version': '2.43.1'
},
environments: [
{ browserName: 'chrome'}
],
maxConcurrency: 3,
tunnel: 'NullTunnel',
loader: {},
suites: [],
functionalSuites: 'tests/all_functional',
reporters: ['console'],
excludeInstrumentation: /^tests\//
});
I tried to use Selenium 2.42.2 with chromedriver 2.10 and chromedriver 2.9 but the results are similar.
Update 1
The same problem persist with OSX 10.10, Java 1.7.0_51 (Java 7 update 71), chromedriver 2.11 and Chrome 38.0.2125.104.
Update 2
I started looking at why there is such a big delay between HttpContext and ServletHandler startup. Debug shows that New random session seed takes that long time (5 sec). It seems that all errors that take longer time have time that is multiple of 5 (5 sec, 10 sec and 25 sec).
On other Unix systems this problem was solved by replacing /dev/random by /dev/urandom but on OSX there should be no difference between them. I tried feeding /dev/random with data while selenium was running but it didn't help.
Running with sudo gives the same result.
Specifying -Djava.security.egd=file:///dev/urandom gives the same result.
Update 3
On a new machine problem disappeared. And as I have no more the old machine - the answer will remain a mystery.
The only thing that I think could be different between these machines is JDK.
I ran into this issue on macOS Sierra when using selenium-standalone-server 2.42.2 and chromedriver 2.25. I tried several version combinations of the two while using java version 1.8.0_91 to no avail.
The issue was resolved by reverting to a previous version of java, java version 1.8.0_45. Not the best solution, so I'm using http://www.jenv.be/ to go back and forth when I need to. This does not identify the issue's root cause but I hope this workaround helps someone, took me a while to find it.

How do I get WebDriver working on a Mac from Haskell?

So (in my ongoing attempts to try and be a Haskell programmer) I thought I'd try using Haskell to automate control of Firefox on a mac. Went to https://github.com/kallisti-dev/hs-webdriver, installed webdriver, installed the standalone java selenium server and tried running the simple Hello World test (after fixing the syntax error, the 'config' argument to runSession should be (I assume) 'myConfig')
Looked like Firefox opened for a moment, then disappeared. The Java based selenium server produced tons of error messages. See below.
Anyone know what's wrong?
For what it's worth, after trying this, I installed the python bindings and had a python version working in about 10 seconds flat!
dhjmacpro:~/bin $ java -jar selenium-server-standalone-2.42.2.jar
Jul 25, 2014 12:32:28 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
12:32:28.052 INFO - Java: Apple Inc. 20.65-b04-462
12:32:28.053 INFO - OS: Mac OS X 10.9.4 x86_64
12:32:28.061 INFO - v2.42.2, with Core v2.42.2. Built from revision 6a6995d
12:32:28.125 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: MAC
12:32:28.153 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
12:32:28.154 INFO - Version Jetty/5.1.x
12:32:28.154 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
12:32:28.155 INFO - Started HttpContext[/selenium-server,/selenium-server]
12:32:28.155 INFO - Started HttpContext[/,/]
12:32:28.185 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#3dbbd23f
12:32:28.185 INFO - Started HttpContext[/wd,/wd]
12:32:28.190 INFO - Started SocketListener on 0.0.0.0:4444
12:32:28.190 INFO - Started org.openqa.jetty.jetty.Server#4ca31e1b
12:32:55.022 INFO - Executing: [new session: Capabilities [{platform=ANY, javascriptEnabled=null, acceptSslCerts=null, firefox_binary=null, browserName=firefox, rotatable=null, locationContextEnabled=null, unexpectedAlertBehavior=null, version=null, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences#45490eb5, firefox_profile=null, databaseEnabled=null, cssSelectorsEnabled=null, handlesAlerts=null, browserConnectionEnabled=null, proxy={proxyType=SYSTEM}, webStorageEnabled=null, nativeEvents=null, applicationCacheEnabled=null, takesScreenshot=null}]])
12:32:55.038 INFO - Creating a new session for Capabilities [{platform=ANY, javascriptEnabled=null, acceptSslCerts=null, firefox_binary=null, browserName=firefox, rotatable=null, locationContextEnabled=null, unexpectedAlertBehavior=null, version=null, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences#45490eb5, firefox_profile=null, databaseEnabled=null, cssSelectorsEnabled=null, handlesAlerts=null, browserConnectionEnabled=null, proxy={proxyType=SYSTEM}, webStorageEnabled=null, nativeEvents=null, applicationCacheEnabled=null, takesScreenshot=null}]
12:32:57.851 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'dhjmacpro', ip: '192.168.0.45', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.6.0_65'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:176)
at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:112)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:89)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:110)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:57)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:112)
at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:173)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:200)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:162)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:128)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'dhjmacpro', ip: '192.168.0.45', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.6.0_65'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:69)
at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:53)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:54)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:215)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:59)
... 10 more
Caused by: org.openqa.selenium.WebDriverException: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIPrefBranch.setCharPref]
Command duration or timeout: 181 milliseconds
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'dhjmacpro', ip: '192.168.0.45', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.6.0_65'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:104)
... 15 more
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIPrefBranch.setCharPref]
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'dhjmacpro', ip: '192.168.0.45', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.6.0_65'
Driver info: driver.version: unknown
12:32:57.857 WARN - Exception: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIPrefBranch.setCharPref]
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'dhjmacpro', ip: '192.168.0.45', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.6.0_65'
Driver info: driver.version: unknown
Okay so it seems that the library has not been updated in about a year but here are my suggestions:
Use homebrew to install selenium-standalone-server and chromedriver. Then use the config to select the standard Chrome configuration.
Beware that the 0.6.1 version of the library is lagging behind the current master that has important fixes to work with the latest selenium-server-standalone. You will find that it is mostly compatible but I ran into one issue: https://github.com/kallisti-dev/hs-webdriver/issues/60
From there you should be able to get the tests up and running. I know that I have it successfully running on my machine. If you have more questions about this approach just ask.

Resources