gpt4 book ai didi

java - Selenium 2 : error: cannot parse capability: chromeOptions

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:01:54 26 4
gpt4 key购买 nike

尝试使用 ChromeDriver 2.9 运行测试时出现以下错误:

unknown error: cannot parse capability: chromeOptions org.openqa.selenium.WebDriverException: unknown error: cannot parse capability: chromeOptions from unknown error: must be a dictionary (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86) (WARNING: The server did not provide any stacktrace information)

这是我的代码:

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”消息)

最佳答案

尝试使用此命令为 Chrome 注册节点

java -jar selenium-server-standalone-2.48.2.jar -role node -hub http://localhost:4444/grid/register -maxSession 15 -browser browserName="chrome",version=ANY,platform=ANY,maxInstances=15 -Dwebdriver.chrome.driver=/path/to/chromedriver

希望对你有帮助

关于java - Selenium 2 : error: cannot parse capability: chromeOptions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27961437/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com