gpt4 book ai didi

java - Internet Explorer 未启动我的 selenium webdriver 代码

转载 作者:太空宇宙 更新时间:2023-11-04 11:56:47 25 4
gpt4 key购买 nike

Selenium WebDriver 代码是:

File file = new File("D:\\Polycom_Space\\WebdriversIEDriverServer_x64_2.53.1\\IEDriverServer.exe");

System.setProperty("webdriver.ie.driver",file.getAbsolutePath());
capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "IE");
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
capabilities.setCapability("requireWindowFocus", true);
driver = new RemoteWebDriver(host, capabilities);



**//grid node configuration is---**

cd Polycom_Space\Java Libraries Server
java -jar selenium-server-standalone-2.53.1.jar -role webDriver -hub http://localhost:4242/grid/register -port 5557 -Dwebdriver.ie.driver=D:\Polycom_Space\Webdrivers

\IEDriverServer_x64_2.53.1\IEDriverServer.exe -browser browserName="internet explorer" -maxInstances=4 -maxSession 1

异常(exception)是:

org.testng.internal.thread.ThreadExecutionException: org.testng.internal.InvokeMethodRunnable$TestNGRuntimeException: java.lang.RuntimeException: Error forwarding the new session cannot find : Capabilities [{ensureCleanSession=true, acceptSslCerts=true, requireWindowFocus=true, browserName=IE, version=, platform=WINDOWS}]

最佳答案

-D 属性应该位于 jarfile 之前(否则它会被视为应用程序的参数,而不是 JVM 的选项)。从java帮助中,用法是

java [-options] -jar jarfile [args...]

尝试执行它

java -Dwebdriver.ie.driver=D:\Polycom_Space\Webdrivers\IEDriverServer_x64_2.53.1\IEDriverServer.exe -jar selenium-server-standalone-2.53.1.jar -role webDriver -hub http://localhost:4242/grid/register -port 5557 -browser browserName="internet explorer" -maxInstances=4 -maxSession 1

关于java - Internet Explorer 未启动我的 selenium webdriver 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41314430/

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