0

I am trying to run headless chrome tests on Ubuntu 14.04.3 using Selenium grid that sits on AWS EC2 server but cannot successfully run any test. I have been looking around for answers, tried many solutions/suggestions, but still failed. The closest answer I can get is that the chromedriver and selenium server versions were out of sync that's why I am getting this kind of error.

Can anyone please suggest latest chromedriver and selenium server versions that can work together successfully? Or can you please help suggest on how I can resolve below error? PS. I am quite new to this stuff and it was 48 years ago when I last used Linux. Any help will be much, much, much appreciated. Thank you very much!

Ubuntu: 14.04.3
Java: 1.7.0_80
Selenium: selenium-server-standalone-2.48.2.jar
chromedriver: 2.20.353124

This was the command I run to register the webdriver to the hub:

root@ip:~# java -jar selenium-server-standalone-2.48.2.jar -Dwebdriver.chrome.driver='/usr/local/bin/chromedriver' -role webdriver -hub http://172.31.40.186:4444/grid/register -port 5555 -browser browserName=chrome,maxInstances=5,platform=LINUX --verbose --log-path='/usr/local/bin/chromedriver.log' &

Error log:

testTemp1(demo.test)  Time elapsed: 63.984 sec  <<< FAILURE!
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 3.13.0-48-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.68 seconds
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'ip-172-31-40-186', ip: '172.31.40.186', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-48-generic', java.version: '1.7.0_80'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command duration or timeout: 62.19 seconds
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'ip-172-31-40-186', ip: '172.31.40.186', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-48-generic', java.version: '1.7.0_80'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
    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:206)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:156)
    at demo.test.testTemp1(test.java:76)
Caused by: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 3.13.0-48-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.68 seconds
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'ip-172-31-40-186', ip: '172.31.40.186', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-48-generic', java.version: '1.7.0_80'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'ip-172-31-40-186', ip: '172.31.40.186', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-48-generic', java.version: '1.7.0_80'
Driver info: driver.version: ChromeDriver
    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:206)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:138)
    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.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:103)
    at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:97)
    at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60)
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222)
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
    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:745)
Iam Riz
  • 117
  • 1
  • 14
  • Check if [this helps](http://stackoverflow.com/questions/22558077/unknown-error-chrome-failed-to-start-exited-abnormally-driver-info-chromedri) – makeMonday Nov 13 '15 at 13:21

1 Answers1

0

Thanks @makeMonday. The link you provided me didn't help me that much, but thanks anyway. I realized I may have had my linux environment all messed up. What I did was update my versions to below in order for my test to get running successfully.

Versions

ubuntu=14.04
google-chrome=46.0.2490.86
chromedriver=2.20.353124
selenium server=2.47.1 or 2.48.2 (though sometimes, I am still getting a "session deleted because of page crash" error)

Then, I run below before running the test.

export DISPLAY=:0
Xvfb :0 -ac -screen 0 1024x768x24 &
google-chrome --remote-debugging-port=9222 &
nohup java -jar ./selenium-server-standalone-2.47.1.jar &
java -jar ./selenium-server-standalone-2.47.1.jar -role node -hub http://<IP>:4444/grid/register -port 5555
Iam Riz
  • 117
  • 1
  • 14