【发布时间】:2017-12-01 13:20:52
【问题描述】:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class sasas {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.gecko.driver","D:\\Firefox\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
String appUrl = "https://accounts.google.com";
driver.manage().window().maximize();
driver.get(appUrl);
System.out.println("Test script executed successfully.");
driver.close();
}
}
这是我正在尝试的示例代码。当我运行时,我收到错误消息 “驱动程序可执行文件不存在:D:\Firefox\geckodriver.exe” 请帮助我继续。我在环境变量中添加了位置,然后我也收到了这个错误。 PATH 我添加为 D:\Samplecode。
请帮帮我
【问题讨论】:
-
geckodriver.exe文件保存在哪里?