App running on Windows 10 machine can't find file App running on Windows 10 machine can't find file selenium selenium

App running on Windows 10 machine can't find file


If you put the chromedriver.exe in the folder Chromedriver_win32.zip which is in the same folder as your script, you can set the driver_path to that file. See code below:

require "selenium-webdriver"Selenium::WebDriver::Chrome.driver_path = File.join(File.absolute_path('./', "Chromedriver_win32.zip/chromedriver.exe"))    driver = Selenium::WebDriver.for :chromedriver.get "https://www.google.com.sg/"


I don't have any knowledge on ruby or ruby-on-rails. please find the equivalent in java or python in Windows OS.

Two ways:

  1. you can keep Chrome driver in a place where it is added to PATH variable (environment variables in Windows 10)
  2. Programmatically set the path to the executable chromedriver.exe

For Java:

 System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");

For Python : (we keep chromedriver.exe in C:\Python27\Scripts location. this location is already added to PATH variable when python (Activestate) is installed. in case, chromedriver.exe is not in one of the PATH locations, you can specify as follows)

driver = webdriver.Chrome('/path/to/chromedriver')  # Optional argument, if not specified will search path.

For Ruby:

Add the ruby installation path to Windows PATH environment variable and keep chromedriver.exe in that location. (Windows searches for binaries in the locations specified in PATH variable.)

For more info on setting ruby installation location to PATHhttps://stackoverflow.com/a/26947536

References:

  1. https://sites.google.com/a/chromium.org/chromedriver/getting-started


I would put this in as a comment, but, since I'm relatively new, I am forced to put it in as an answer, which it might well be...

Pardon me if I'm asking the obvious, but, did you try "unzipping" the file and putting the ".exe" file into that directory? The file you mentioned (you said.. titled "chromedriver_win32.zip") is not an executable file in Windows. The file you should be looking for is chromedriver.exe.