0

I deployed my application using Ruby, Sinatra and Redis DataBase, on my ubuntu remote host named Scaleway.

In this way, i've install all what i need, and i can acces to my application. So when i want to use my script, who use Watir gem (selenium), it's always show me this error :

Selenium::WebDriver::Error::WebDriverError at /show_result unable to connect to chromedriver 127.0.0.1:9515

I know that i need Xvfb (who is installed), the headless gem (that i implemented in my code), and chromedriver that i installed by the same way that i installed it on my local machine. On my local machine, it works perfectly, but in my remote host, it show me this error above.

Did you know how to fix this problem ? How did you install Chromedriver so that my program recognizes it ?

  • It's weird, because now i no longer have this error, but i have `Net::ReadTimeout: Net::ReadTimeout` I know where this error come from, it's happen when i initialize my `@browser = Watir::Browser.new(:chrome)` I just initialize the Headless gem above initialize Watir. – Vincent Cheloudiakoff Aug 07 '17 at 15:39

1 Answers1

0

Did you run the watir command using xvfb with something like this

xvfb-run <here is your command>

Also Chromedriver should place properly so it can be access anywhere, usually I put chromedriver at /usr/bin/ or /usr/sbin/

mcbuddy
  • 199
  • 1
  • 9
  • On my machine, i already put chromedriver to /usr/local/bin/ and it's work. So i try to switch to the /usr/bin/ repository. I don't used xvfb command on my code, i have to learn how to use this gem ! – Vincent Cheloudiakoff Aug 05 '17 at 11:27
  • I tried to do some things to run xvfb-run, but i don't understand how should i used these commands. Did you have an exemple to run that on a remote host, in order to be able to connect to chromedriver ? I also used the headless gem, that i implement like : `@headless = Headless.new` `@headless.start` `// code` `@browser.close` `@headless.destroy ` – Vincent Cheloudiakoff Aug 07 '17 at 10:05
  • Might you wrap this `Watir` code to ruby script right? So try run like `xvfb-run ruby .rb` – mcbuddy Aug 07 '17 at 20:09
  • This is very weird, because i no longer have this error, but i have this: `Net::ReadTimeout (Net::ReadTimeout)` I try to run my script like this, so when i run my server.rb like `xvfb-run ruby server.rb -p 80 -o 0.0.0.0` sinatra tell me that my route is not exist, while i've them well.. When i try to run my script without Sinatra, but with the both needed parameters like : `xvfb-run ruby start.rb param1 param2' This tell me the ReadTimeOut error – Vincent Cheloudiakoff Aug 08 '17 at 10:28