selenium 2 铬驱动程序 [英] selenium 2 chrome driver
问题描述
所以我已经阅读了所有关于将 chromedriver 添加到我的路径的文档并遵循了所有这些文档.我在一台装有 selenium2、maven、eclipse 和所有最新驱动程序的 Mac 上:
So I have read all the docs on adding chromedriver to my path and followed all of them. I am on a Mac with selenium2, maven, eclipse, and all the latest drivers:
Error:
The path to the chromedriver executable must be set by the webdriver.chrome.driver system property;
我将 chromedriver 放在我的 Applications 文件夹中,我的路径如下所示:
I put chromedriver in my Applications folder and my path looks like:
echo $PATH
/Users/tcerrato/selenium/BS_Sel_Project/auto_helper/test_scripts:/usr/local/apache-maven-2.2.1//bin:/Users/oracle/oracle/product/10.2.0/db_1/bin:/opt/local/bin:/opt/local/sbin:/Applications:
我错过了什么?我根本无法使用 chrome 驱动程序运行.任何帮助都会很棒我现在正在尝试随机的东西.
What am I missing? I cannot run with chrome driver at all. Any help would be great I'm trying random stuff now.
这是我关于硒的 pom 部分:
Here is my pom section on selenium:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium</artifactId>
<version>2.0rc2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.6.0</version>
</dependency>
推荐答案
我不确定 Maven 但这是我如何设置属性 webdriver.chrome.driver
I am not sure about Maven but this how I set the property webdriver.chrome.driver
System.setProperty("webdriver.chrome.driver", "C:\pathto\my\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
这篇关于selenium 2 铬驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!