I\'m trying to get Selenium tests running with Chrome. I\'m using C#.
var options = new OpenQA.Selenium.Chrome.ChromeOptions();
options.BinaryLocation = @\"C:\\U
This is a typical problem in some localized Windows XP distributions.
I describe a solution for Python because it is different, without CamelCase property BinaryLocation identifier and it is less documented. Yes, a general solution is to create a new instance of ChromeOptions, but it is possible simply to fix the bug dynamically directly by ChromeOptions by some code started first 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 code unchanged:
from selenium import webdriver
browser = webdriver.Chrome()
It is important to use ur"..."
unicode raw string literal in Python (not byte string, if the path contains international characters) and not normal u"..."
if the the complete path is hardcoded and the username starts with some character special after \
like \n \r \t
.