Selenium / Watir on cloud9


#1

Hello.

I’m trying to run a very simple code, just to test the behaviour of C9 with watir gem.

browser = Watir::Browser.new 
browser.goto "https://www.google.com"

When I run it I have the follow error:

Selenium::WebDriver::Error::WebDriverError: unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)

I googled it, but it seens that C9 does not support headless Selenium browser.
Can anyone confirm or give some hint to run Selenium?


#2

I tried to install chromewebdriver-helper and use chrome as the browser.

A chrome error raised:
unknown error: Chrome failed to start: exited abnormally

I checked the gem versions and all gems (‘watir-webdriver’, ‘selenium-webdriver’, ‘chromedriver-helper’ ) are updated.

It seens that C9 does not suport Selenium.


#3

Is this Selenium thing some sort of server? If so, you’ll need to bind it to the ip 0.0.0.0 and one of the 3 open ports, 8080, 8081, and 8082. Without these ports, it will not communicate to the outside world.


#4

Usually you run headless browser instances using xvfb so you might want to give that a try. I personally had no luck getting that to work on cloud9, and ended up swapping out selenium for poltergeist which uses phantomjs as a headless webkit.


#5

I was able to test js using firefox and xvfb
1)Installatiom:
sudo apt-get install firefox xvfb
2) Run tests (prepend condole command with xvfb-run)
xvfb-run bin/rspec spec/features/