我正在尝试将 selenium 与 sikuli 一起使用。所以 sikuli 不会使用当前的 java 设置在 64 位上运行,因此在我的项目中将运行时更改为指向 32 位运行时环境,并使用 32 位 iewebdriver 添加我的 selenium jars我对上面的内容有疑问查看了网上的每个地方添加了 guava.jar 文件 v.21 它没有解决问题将其更改为 guava 26jre.jar 但仍然没有任何效果这里是我的代码和错误(如果有人可以)发现我哪里出错了
error
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)V
at org.openqa.selenium.remote.service.DriverService$Builder.usingPort(DriverService.java:285)
at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:242)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:211)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:150)
at riOSikuliAutomation.RiOSikuliAutomation.main(RiOSikuliAutomation.java:33)
这是我的代码
DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
cap.setCapability("nativeEvents", false);
cap.setCapability("unexpectedAlertBehaviour", "accept");
cap.setCapability("ignoreProtectedModeSettings", true);
cap.setCapability("disable-popup-blocking", true);
cap.setCapability("enablePersistentHover", true);
cap.setCapability("ignoreZoomSetting", true);
cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
InternetExplorerOptions options = new InternetExplorerOptions();
options.merge(cap);
System.setProperty("webdriver.ie.driver", "C:\\Users\\Selenium\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver(options);
一旦它读取最后一行,就会弹出错误,我有什么做得不对的地方,请告知?
这个错误信息...
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)V
...意味着IE驱动服务器无法启动/产生新的网页浏览会话 i.e. Internet Explorer 浏览器会议。
你的主要问题是不兼容您正在使用的二进制版本之间的关系如下:
- 你提到过使用番石榴-21.0-jre.jar这很漂亮ancient.
Solution
您的问题的解决方案是以下任一/全部步骤:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)