TheBrainFamily / chimpy

Develop acceptance tests & end-to-end tests with realtime feedback.
https://thebrainfamily.github.io/chimpy
MIT License
52 stars 28 forks source link

Error Chrome not reachable #61

Open samhatoum opened 6 years ago

samhatoum commented 6 years ago

Issue by vishal0532 Friday Nov 18, 2016 at 09:26 GMT Originally opened as https://github.com/xolvio/chimp/issues/528


Expected behaviour

Script should be running & opening chrome browser instance & navigating to the url

Actual behaviour

Getting error as "Error Chrome not reachable"

Exact steps to reproduce / repository that demonstrates the problem

Please put long code snips in a Gist and provide a link here. I have prepared a step_def.js file having the below code snippet module.exports = function() {

this.Given(/^I have visited the website$/, function () { browser.url('http://google.com'); }); } When i start chimp through the command chimp --watch then i get the below error Failures:

1) Scenario: Search for Xolv.io - features\search.feature:8 Step: Given I have visited the website - features\search.feature:9 Step Definition: features\support\step_defs.js:3 Message: Error: chrome not reachable

Version & tools:

Please put long logs in a Gist and provide a link here.


Join our Slack xolv.io/community #chimp channel, where you can find help and help others.

samhatoum commented 6 years ago

Comment by StephenDavidson Monday Dec 05, 2016 at 11:25 GMT


What version chromedriver are you using?

samhatoum commented 6 years ago

Comment by samhatoum Thursday Dec 15, 2016 at 13:54 GMT


closing this due to no response from @vishal0532

samhatoum commented 6 years ago

Comment by merlinpatt Thursday Dec 15, 2016 at 19:29 GMT


I'm getting this same error

{ [Error: unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=Linux 3.19.0-25-generic x86_64)]
  message: 'unknown error: cannot find Chrome binary\n  (Driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=Linux 3.19.0-25-generic x86_64)',
  type: 'RuntimeError',
  seleniumStack:
   { status: 13,
     type: 'UnknownError',
     message: 'An unknown server-side error occurred while processing the command.',
     orgStatusMessage: 'unknown error: cannot find Chrome binary\n  (Driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=Linux 3.19.0-25-generic x86_64)' } }
Error: unknown error: cannot find Chrome binary
    at initBrowser (node_modules/chimp/dist/lib/chimp-helper.js:162:17)
    at Object.setupBrowserAndDDP (node_modules/chimp/dist/lib/chimp-helper.js:231:7)
    at Context.<anonymous> (node_modules/chimp/dist/lib/mocha/mocha-helper.js:11:15)
    at node_modules/chimp/dist/lib/utils/fiberize.js:25:14
    (Driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=Linux 3.19.0-25-generic x86_64)

I'm attempting to use the version of chromedriver available through npm, and then link it within various bin directories. When I run chromedriver --version, I get ChromeDriver 2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e)

samhatoum commented 6 years ago

Comment by samhatoum Thursday Dec 15, 2016 at 19:33 GMT


this is a different error I think. Do you have chrome installed?

samhatoum commented 6 years ago

Comment by merlinpatt Thursday Dec 15, 2016 at 19:39 GMT


Well I thought I could just get the chromedriver and skip installing Chrome, which is why I installed it from npm.

But that didn't work, so I ran wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb and then sudo dpkg -I google-chrome-stable_current_amd64.deb to install Chrome, and it's still the same error

samhatoum commented 6 years ago

Comment by samhatoum Thursday Dec 15, 2016 at 19:44 GMT


well chromedriver saves you from needing selenium & java. It's the webdriver basically however it still needs Chrome

What is the error now?

samhatoum commented 6 years ago

Comment by merlinpatt Thursday Dec 15, 2016 at 19:46 GMT


It's still the same error as above.

Can you tell me where chimp expects the chromedriver to be and how to use the configuration file to set the path?

I tried with this config file but it didn't work

module.exports = {
  webdriverio: {
    desiredCapabilities: {
      browserName: 'chrome',
      chromeOptions: {binary: '/usr/bin/chromedriver'},
    },
  },
};
samhatoum commented 6 years ago

Comment by samhatoum Thursday Dec 15, 2016 at 19:48 GMT


I believe its' this:

desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions: {
            binary: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
        }
    }
samhatoum commented 6 years ago

Comment by merlinpatt Thursday Dec 15, 2016 at 19:51 GMT


Apologies I should have specified, I'm running this on Ubuntu 14.04.3 LTS.

So I don't need module.exports or webdriverio specified?

samhatoum commented 6 years ago

Comment by samhatoum Thursday Dec 15, 2016 at 19:59 GMT


my bad, I was being lazy...

module.exports = {
  webdriverio: {
    desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions: {
            binary: '<path to your chrome binary>'
        }
    }
}
samhatoum commented 6 years ago

Comment by merlinpatt Thursday Dec 15, 2016 at 20:02 GMT


Yes, that's what I do have, and it's not working.

samhatoum commented 6 years ago

Comment by samhatoum Thursday Dec 15, 2016 at 20:14 GMT


hmm. try this:

start chromedriver with this:

then run this:

chromedriver --url-base=wd/hub --verbose

then in another tab/window

curl -XPOST http://localhost:9515/wd/hub/session -d '{"desiredCapabilities":{"browserName":"chrome"}}'
samhatoum commented 6 years ago

Comment by samhatoum Thursday Dec 15, 2016 at 20:15 GMT


this way you can debug the issue without Chimp being part of the equation

samhatoum commented 6 years ago

Comment by merlinpatt Thursday Dec 15, 2016 at 20:22 GMT


This is what I get when I start it without chimp

Starting ChromeDriver 2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e) on port 9515
Only local connections are allowed.
[14.443][INFO]: COMMAND InitSession {
   "desiredCapabilities": {
      "browserName": "chrome"
   }
}
[14.449][INFO]: RESPONSE InitSession unknown error: cannot find Chrome binary
[14.450][DEBUG]: Log type 'driver' lost 0 entries on destruction
[14.450][DEBUG]: Log type 'browser' lost 0 entries on destruction
samhatoum commented 6 years ago

Comment by samhatoum Thursday Dec 15, 2016 at 20:23 GMT


are you able to start chrome manually?

samhatoum commented 6 years ago

Comment by merlinpatt Thursday Dec 15, 2016 at 20:25 GMT


If by that you mean click the icon to open, I can't do that. I'm attempting to do this headlessly in a vagrant set up virtual machine

samhatoum commented 6 years ago

Comment by samhatoum Thursday Dec 15, 2016 at 20:26 GMT


I mean from the command line. Have you started Xvfb?

Also, it would be better if you come to http://xolv.io/community

samhatoum commented 6 years ago

Comment by merlinpatt Thursday Dec 15, 2016 at 20:42 GMT


@samhatoum Thank you so much for your quick help! I was able to get it working. As it turns out, the the capital -I flag was for getting info, not installing. Once Chrome installed, it did work. Thank you again.

samhatoum commented 6 years ago

Comment by samhatoum Thursday Dec 15, 2016 at 21:53 GMT


great to hear. you're welcome