找不到默认的Chrome二进制文件 [英] Could not find default Chrome binary
问题描述
我正在使用chrome webdriver用于一个项目,当我在本地PC上运行该项目时效果很好,但是当我将该项目上传到远程服务器以使其能够实时运行时,chromedriver无法加载:
I am using the chrome webdriver for a project which works well when I run it on my local pc, however when I uploaded the project to my remote server for it to run live, the chromedriver could not load:
这是我给chromedriver打电话的方式:
this is how I am calling my chromedriver:
IWebDriver driver = new ChromeDriver(@"C:\Users\User\Downloads\chromedriver_win_26.0.1383.0");
这是我得到的错误:
找不到默认的Chrome二进制文件
Could not find default Chrome binary
我已确保:
- chromedriver.exe实际上位于服务器上的指定位置
- 我上传了运行它所需的dll
请问关于为什么发生这种情况的任何想法?
Any ideas please as to why this is happening?
推荐答案
WebDriver部分很好,但是我发现问题是代码无法找到Chrome.exe本身.
The WebDriver part is fine, but I found that the problem is that the code can't find Chrome.exe itself.
应将其安装在以下文件夹中: C:\ Users \%USERNAME%\ AppData \ Local \ Google \ Chrome \ Application \ chrome.exe
It should be installed in this folder: C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe
请检查以下要求: http://code.google.com/p/selenium/wiki/ChromeDriver
P.s:我进行了自我测试,现在可以使用了. :)
P.s: I tested myself and it works now. :)
这篇关于找不到默认的Chrome二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!