Selenim WebDriver - Could not find chrome binary

I am trying to run Selenium tests with Chrome. I am using C #.

var options = new OpenQA.Selenium.Chrome.ChromeOptions(); options.BinaryLocation = @"C:\Users\Vilem\AppData\Local\Google\Chrome\Application\"; using (IWebDriver driver = new OpenQA.Selenium.Chrome.ChromeDriver(options)) { ... 

It looks like the chromedriver.exe file is detected, but it can find the Chrome binary. I set the path to chrome.exe explicitly after an automatic search. I even tried it with "chrome.exe" at the end. I always get the same result:

Could not find Chrome fraction:

C: \ Users \ Willem \ AppData \ Local \ Google \ Chrome \ Application


FYI: I have a question regarding 3 seleniums. I am trying to split the question into several to make the discussion easier. Original: Selenium WebDriver - the driver does not work for me

+6
source share
5 answers

This is a typical problem in some localized distributions of Windows XP .

I am describing a solution for Python because it is different, without the identifier of the CamelCase BinaryLocation object, and it is less documented. Yes, the general solution is to create a new instance of ChromeOptions, but you can simply fix the error dynamically directly using ChromeOptions using some code started somewhere somewhere:

 from selenium import webdriver webdriver.ChromeOptions.binary_location = ur"c:\Documents and Settings\user name\Local Settings\Data aplikací\Google\Chrome\Application\chrome.exe" 

and leave all other codes unchanged:

 from selenium import webdriver browser = webdriver.Chrome() 

It is important to use ur"..." unicode raw string literal in Python (not in a byte string if the path contains international characters), and not the usual u"..." if the full path is hard-coded and the username begins with a special character after \ like \n \r \t .

+2
source

Download "chromedriver_win_22_0_1203_0b.zip", extract it and set the path as follows: (I set my path)

 options.BinaryLocation = @"F:\\Software Download_Ripon\\WebDriver\\chromedriver_win_22_0_1203_0b\\chromedriver.exe"; 

The above should work well

+1
source

I ran into the same problem for php web driver.

Install chrome in the default directory, Chrome installations will automatically install the application in the default folder:

% HOMEPATH% \ Local Settings \ Application Data \ Google \ Chrome \ Application \ chrome.exe

Please browse this wiki page for more information. http://code.google.com/p/selenium/wiki/ChromeDriver

0
source

Not a problem that you are missing chrome.exe at the end of the path?

In other words, the path should include the executable , and not just the folder in which the executable is located.

0
source

In the path that you specified for the Chrome binary, also specify chrome.exe . He will work!

0
source

Source: https://habr.com/ru/post/920605/


All Articles