FuckTheWorld / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Setting `binary_location` results in Chrome not starting #1131

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Chrome will not start using Selenium's Python/chromedriver bindings if I 
attempt to set the Chrome binary location. Even if I use the default value:

    from selenium import webdriver
    from time import sleep
    path = 'no_binary_location.log'
    args = ['--verbose']
    options = webdriver.ChromeOptions()
    options.binary_location = '/Applications/Google Chrome.app/Contents/MacOs/Google Chrome'
    driver = webdriver.Chrome(chrome_options=options, service_args=args, service_log_path=path)
    driver.get('https://www.google.com')
    sleep(3)
    driver.quit()

Perhaps I have some odd syntax issue? Do I need to set other options when 
setting binary location?

What I really want to do is launch Google Chrome Canary ... but I dropped down 
to the default application location for troubleshooting.

If I comment out the binary_location assignment, Chrome launches as expected.

A crash dump is generated immediately, which explains why the Dev Tools are 
unresponsive. But Chrome DID at least attempt to launch.

Same results on my primary work laptop (Mavericks) and an almost virgin install 
of Yosemite on an older Mac Mini

Full logs included. I suspect enabling/disabling one of the many chrome 
settings could get things to work, but this seems like a bug (or some really 
stupid syntax thing on my part).

Mac OS: 10.9.5, 10.10.3
Chrome: 43.0.2357.124 (64-bit)
Python: 2.7.8 (brew), 2.7.6 (10.10.3 system python)
Selenium: 2.46.0
chromedriver 2.14, 2.15, 2.16

Original issue reported on code.google.com by stvs...@gmail.com on 20 Jun 2015 at 11:06

Attachments:

GoogleCodeExporter commented 9 years ago
stvsmth

Unable to reproduce issue with chromedriver:2.16. Please try with latest 
chromedriver:2.16 and let us know if you still facing the issue.

Please find below sample code:
from selenium import webdriver
from selenium.webdriver import ChromeOptions 

log_path='/path/to/chromedriver.log'
chromedriver_path = "/path/to/chromedriver"
chrome_path = "/path/to/chrome"

opts = webdriver.ChromeOptions()
opts.binary_location = chrome_path

args = ['--verbose']

driver = webdriver.Chrome(executable_path=chromedriver_path, service_args=args, 
service_log_path=log_path)
driver.get('http://www.google.com/xhtml')
sleep(5)
driver.quit()

Original comment by ssudunag...@chromium.org on 22 Jun 2015 at 10:37

GoogleCodeExporter commented 9 years ago
Well then .... Linus' recent rant about the Mac OS filesystem certainly rings 
true for me today

Turns out that both commands below will return output ... but the filename of 
the binary is MacOS not MacOs

12:05 $ file "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome: Mach-O 64-bit 
executable x86_64

12:07 $ file "/Applications/Google Chrome.app/Contents/MacOs/Google Chrome"
/Applications/Google Chrome.app/Contents/MacOs/Google Chrome: Mach-O 64-bit 
executable x86_64

User error. Thanks.

Original comment by stvs...@gmail.com on 23 Jun 2015 at 6:09

GoogleCodeExporter commented 9 years ago
Closing issue as is not reproducible.

Original comment by ssudunag...@chromium.org on 25 Jun 2015 at 6:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
+

In the path Google Chrome.app seems to be incorrect for CANARY it should be:- 

options.binary_location =  /Applications/Google Chrome 
Canary.app/Contents/MacOS/Google Chrome Canary

And it worked for me.

Original comment by agau...@chromium.org on 25 Jun 2015 at 7:31