Question

We're using an Rspec - Capybara - Selenium stack to run acceptance tests.

I'd like to bundle chromedriver.exe with my app so I can control the version and use different versions between apps. Is this possible?

It seems like somewhere in my Capybara setup I should be able to specify this path, rather than relying on what's in the bin.

Was it helpful?

Solution

Yes, this is possible.

Just add your chromedriver.exe binary to the project directory, then when you run your tests, be sure to use relative paths.

In Java, it would look something like this.

src/
  main/
    tests/
      MyTest.java
chromedriver.exe

Then the test would look like:

...
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
...

In ruby, I assume it'd be something similar.

Also, if you intend to do something like this, i'd recommend stating the version in the executable. For example: chromedriver-2.39.0.exe

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top