1

I've been working on setting up Selenium Grid2 in the cloud and I'm now getting an error that I cannot figure out.

Selenium::WebDriver::Error::UnknownError: Unable to connect to host 127.0.0.1 on port 7057 after 45000 ms. Firefox console output:
  Error: no display specified
  Error: no display specified

I've started two nodes - Hub and WebDriver

java -jar selenium-server-standalone-2.32.0.jar -role hub -port 7055
java -jar selenium-server-standalone-2.32.0.jar -role webdriver  -hub http://ec2-54-244-219-84.us-west-2.compute.amazonaws.com:7055/grid/register

I've installed Xvfb and I've started a screen using.

Xvfb :99 -screen 0 1024x768x24 &

I've also set the display environment variable.

export DISPLAY=:99

I'm trying to run a simple test on Amazon EC2.

require 'headless'
require 'selenium-webdriver'

# Start the headless browser
headless = Headless.new
headless.start
browser = Selenium::WebDriver.for(:remote, :url => "http://localhost:7055/wd/hub")

# Print google.com's title
browser.get('http://google.com')
puts browser.title

# Close the browser
browser.quit
headless.destroy

Or from my local machine

require 'headless'
require 'selenium-webdriver'

# Start the headless browser
headless = Headless.new
headless.start
browser = Selenium::WebDriver.for(:remote, :url => "http://ec2-54-244-205-27.us-west-2.compute.amazonaws.com:7055/wd/hub")

# Print google.com's title
browser.get('http://google.com')
puts browser.title

# Close the browser
browser.quit
headless.destroy

But I still get the above error...

Error: no display specified

Also, when I try to run FireFox from Command Line...

Xlib:  extension "RANDR" missing on display ":99".

1 Answer 1

4

What solved this issue for me was doing the following...

Instead of running the webdriver node like this...

java -jar selenium-server-standalone-2.32.0.jar -role webdriver  -hub http://ec2-54-244-219-84.us-west-2.compute.amazonaws.com:7055/grid/register

I added xvfb-run before the command...

xvfb-run java -jar selenium-server-standalone-2.32.0.jar -role webdriver  -hub http://ec2-54-244-219-84.us-west-2.compute.amazonaws.com:7055/grid/register
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.