0

Machine Details

AME="Amazon Linux AMI"
VERSION="2017.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2017.03"
PRETTY_NAME="Amazon Linux AMI 2017.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2017.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

I am new to selenium stand alone. I have downloaded the latest java version, stand alone using NPM, XVFB and am trying to create sessions after turning on the standalone using the following command:

sudo xvfb-run --server-args="-screen 0, 1366x768x24" selenium-standalone start -- -debug

Please also note that I have attempted this using a Hub and Node also trying to run Selenium tests using C# on my local client.

When I try to create a Chrome session I receive this error (The polling will continue for a few seconds):

DEBUG - Waiting for [http://localhost:29837/status]
DEBUG - Polling http://localhost:29837/status
/usr/lib/node_modules/selenium-standalone/.selenium/chromedriver/2.32-
x64-chromedriver: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
DEBUG - Polling http://localhost:29837/status
DEBUG - Polling http://localhost:29837/status
DEBUG - Polling http://localhost:29837/status
ERROR - org.apache.commons.exec.ExecuteException: Process exited with an error: 127 (Exit value: 127)
^C/usr/bin/xvfb-run: line 171: kill: (6252) - No such process

When trying to create a Firefox session:

14:30:26.416 INFO - Binding default provider to: org.openqa.selenium.chrome.ChromeDriverService
14:30:26.418 INFO - Found handler: org.openqa.selenium.remote.server.BeginSession@44e7a749
14:30:26.418 INFO - /session: Executing POST on /session (handler: BeginSession)
14:30:26.442 DEBUG - Memory-based payload for: {desiredCapabilities={browserName=firefox}}
14:30:26.453 INFO - Capabilities are: Capabilities {browserName=firefox}
14:30:26.457 INFO - Capabilities {browserName=firefox} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.firefox.GeckoDriverService)
14:30:26.458 INFO - Capabilities {browserName=firefox} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
1506349826497   geckodriver INFO    geckodriver 0.18.0
1506349826501   geckodriver INFO    Listening on 127.0.0.1:5611
DEBUG - CookieSpec selected: default
DEBUG - Auth cache not set in the context
DEBUG - Connection request: [route: {}->http://localhost:5611][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
DEBUG - Connection leased: [id: 0][route: {}->http://localhost:5611][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
DEBUG - Opening connection {}->http://localhost:5611
DEBUG - Connecting to localhost/127.0.0.1:5611
DEBUG - Connection established 127.0.0.1:59276<->127.0.0.1:5611
DEBUG - http-outgoing-0: set socket timeout to 10800000
DEBUG - Executing request POST /session HTTP/1.1
DEBUG - Target auth state: UNCHALLENGED
DEBUG - Proxy auth state: UNCHALLENGED
DEBUG - http-outgoing-0 >> POST /session HTTP/1.1
DEBUG - http-outgoing-0 >> Content-Type: application/json; charset=utf-8
DEBUG - http-outgoing-0 >> Content-Length: 49
DEBUG - http-outgoing-0 >> Host: localhost:5611
DEBUG - http-outgoing-0 >> Connection: Keep-Alive
DEBUG - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_131)
DEBUG - http-outgoing-0 >> Accept-Encoding: gzip,deflate
DEBUG - http-outgoing-0 >> "POST /session HTTP/1.1[\r][\n]"
DEBUG - http-outgoing-0 >> "Content-Type: application/json; charset=utf-8[\r][\n]"
DEBUG - http-outgoing-0 >> "Content-Length: 49[\r][\n]"
DEBUG - http-outgoing-0 >> "Host: localhost:5611[\r][\n]"
DEBUG - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
DEBUG - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_131)[\r][\n]"
DEBUG - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
DEBUG - http-outgoing-0 >> "[\r][\n]"
DEBUG - http-outgoing-0 >> "{"desiredCapabilities":{"browserName":"firefox"}}"
DEBUG - http-outgoing-0 << "HTTP/1.1 500 Internal Server Error[\r][\n]"
DEBUG - http-outgoing-0 << "Connection: close[\r][\n]"
DEBUG - http-outgoing-0 << "Content-Type: application/json; charset=utf-8[\r][\n]"
DEBUG - http-outgoing-0 << "Cache-Control: no-cache[\r][\n]"
DEBUG - http-outgoing-0 << "Content-Length: 1337[\r][\n]"
DEBUG - http-outgoing-0 << "Date: Mon, 25 Sep 2017 14:30:27 GMT[\r][\n]"
DEBUG - http-outgoing-0 << "[\r][\n]"
DEBUG - http-outgoing-0 << "{"value":{"error":"session not created","message":"Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line","stacktrace":"stack backtrace:\n   0:           0x5787ed - backtrace::backtrace::trace::h59229d13f6a8837d\n   1:           0x578942 - backtrace::capture::Backtrace::new::h23089c033eded8f0\n   2:           0x44da3d - geckodriver::marionette::MarionetteHandler::create_connection::h6f7058fccafe4367\n   3:           0x425c32 - <webdriver::server::Dispatcher<T, U>>::run::h8f5348b8f5f7c053\n   4:           0x40b22c - std::panicking::try::do_call::hb67c6fb6bcd96195\n   5:           0x5dc20a - panic_unwind::__rust_maybe_catch_panic\n                        at /checkout/src/libpanic_unwind/lib.rs:98\n   6:           0x41b943 - <F as alloc::boxed::FnBox<A>>::call_box::h4100941edc372034\n   7:           0x5d48a4 - alloc::boxed::{{impl}}::call_once<(),()>\n                        at /checkout/src/liballoc/boxed.rs:650\n                         - std::sys_common::thread::start_thread\n                        at /checkout/src/libstd/sys_common/thread.rs:21\n                         - std::sys::imp::thread::{{impl}}::new::thread_start\n                        at /checkout/src/libstd/sys/unix/thread.rs:84"}}"
DEBUG - http-outgoing-0 << HTTP/1.1 500 Internal Server Error
DEBUG - http-outgoing-0 << Connection: close
DEBUG - http-outgoing-0 << Content-Type: application/json; charset=utf-8
DEBUG - http-outgoing-0 << Cache-Control: no-cache
DEBUG - http-outgoing-0 << Content-Length: 1337
DEBUG - http-outgoing-0 << Date: Mon, 25 Sep 2017 14:30:27 GMT
DEBUG - http-outgoing-0: Close connection
DEBUG - Connection discarded
DEBUG - Connection released: [id: 0][route: {}->http://localhost:5611][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]

On trying to run this command to install the latest Stable Google Chrome:

sudo yum -y localinstall google-chrome-stable_current_x86_64.rpm

Or

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm 

I get this error:

Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libgdk-3.so.0()(64bit)
Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libXss.so.1()(64bit)
Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libatk-1.0.so.0()(64bit)
Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libgdk_pixbuf-2.0.so.0()(64bit)
Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libgconf-2.so.4()(64bit)
Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: libgtk-3.so.0()(64bit)
Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64 (/google-chrome-stable_current_x86_64)
           Requires: xdg-utils
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Has anyone come across this issue and have anyway to solve this? Please let me know if you have any questions.

Lgalan90
  • 595
  • 2
  • 12
  • 31
  • With firefox it looks like the issue is that it can't find the binary, with chrome you have all sorts of library issues that you must resolve before installing chrome and been able to execute the chrome driver. this has nothing to do with selenium or c# – so cal cheesehead Sep 25 '17 at 15:54

1 Answers1

0

I was not able to install the libraries on the Linux AMI but what I ended up doing was installing it on a Ubuntu instance. This made for a pretty simple install using the following doc: https://www.npmjs.com/package/selenium-standalone

HOWEVER, I received a binary error with my Ubuntu linux as well. The issue was that I did not have the browser installed on my Linux Machine and I was able to do so using the instructions here: https://askubuntu.com/questions/510056/how-to-install-google-chrome

Works well with FireFox too:

#install firefox browser
sudo apt-get install firefox
Lgalan90
  • 595
  • 2
  • 12
  • 31