Reputation: 4264
I have installed both Chrome 32 bit version and Chrome Canary. When I run Webdriver, it always opens up the 32 bit version. This is due to the path that I provide.
When I try selecting the executable path for Canary, the code times out without opening it. Is it due to some faulty executable path or something else?
I found out that the executable path for Canary is this :
C:\Users\samsung\AppData\Local\Google\Chrome SxS\Application [ specific to my system]
And I am using this path in the System.SetProperty() function as :
System.setProperty("webdriver.chrome.driver", "C:\Users\samsung\AppData\Local\Google\Chrome SxS\Application\chrome");
What am I doing wrong here?
Upvotes: 0
Views: 1567
Reputation: 11
You can use either of two following ways to open Canary but not Chrome.
Option 1:
driver = webdriver.ChromeOptions()
driver = webdriver.Chrome('C:\Users\shejain\AppData\Local\Google\Chrome SxS\Application\chrome.exe')
Option 2:
sw=webbrowser.get("C:/Users/shejain/AppData/Local/Google/Chrome SxS/Application/chrome.exe %s")
sw.open("www.example.com")
Upvotes: 1
Reputation: 286
The command you are using is to set the location to where the chromedriver is located and not Chrome itself. You should refer to the ChromeDriver documentation for more on how to set these settings (https://sites.google.com/a/chromium.org/chromedriver/capabilities)
The particular one you are looking for is the setBinary option to specify where it should look for Chrome. The following code should work a little better than what you were trying:
ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/other/chrome/binary");
Hope this helps!
Upvotes: 0