【发布时间】:2015-01-15 10:32:23
【问题描述】:
尝试使用 ChromeDriver 2.9 运行测试时出现以下错误:
未知错误:无法解析功能:chromeOptions org.openqa.selenium.WebDriverException:未知错误:无法解析功能:chromeOptions 来自未知错误:必须是字典 (驱动程序信息:chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86)(警告:服务器未提供任何堆栈跟踪 信息)
这是我的代码:
File file = new File("C:/Users/Desktop/TestSE/chromedriver.exe");
System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
driver = new ChromeDriver();
baseUrl = "http://localhost:8080/";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
我还使用以下命令运行我的 selenuim 服务器:
java -jar selenium-server-standalone-2.44.0.jar -Dwebdriver.chrome.driver=chromedriver.exe
我的服务器运行正常(我通过 thsi url 检查了:http://localhost:4444/selenium-server/driver/?cmd=getLogMessages 并且我有“OK”作为消息)
【问题讨论】:
标签: java google-chrome selenium selenium-webdriver