简体   繁体   中英

Main thread exception

I am automating desktop application using Winium. I am trying to launch winium desktop server using script. Whenever I try to do that I am getting below exception Note: If I launch the desktop server manually I am not getting any errors

exception in thread main java.lang.nosuchmethoderror com.google.common.util.concurrent.SimpleTimeLimiter.create(Ljava/util/concurrent/ExecutorService;)LCom/google/common/util/concurrent/SimpleTimeLimiter;
at org.openqa.Selenium.net.urlchecker.<init>(Urlchecker.java:62)
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:187)
at org.openqa.Selenium.remote.service.DriverService.start(DriverService.java:83)

Code I used to launch my application is below

String applicationpath="//my app path";
String winiumDriverPath="//path to my winium driver";
DesktopOptions options = new DesktopOptions();
options.setApplicationPath(//applicationpath);
WiniumDriverService service = new WiniumDriverService.Builder().usingDriverExecutable(new
File(winiumDriverPath)).usingPort(9999).withVerbose(true).withSilent(false).buildDesktopService();
service.start(); // getting error here    
driver = new WiniumDriver(service, options);

Kindly suggest me some ways to overcome this error.

Actually this should be a comment, but I don't have the reputation :)

NoSuchMethodError may be caused if you have multiple versions of an API in your dependency. Mostly because one of your dependencies imports it a second time. It might be worth a try to check your dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM