1
Maven 프로젝트에서 WebDriverManager를 사용하여 ChromeDriver를 열려고 할 때 예외가 발생합니다.Maven 프로젝트에서 WebDriverManager로 ChromeDriver를 실행할 때 예외가 발생했습니다.
내가 계획하고있는 프레임 워크는 pom.xml에 종속성을 추가 한 후 WebDriverManager에서 ChromeDriver를 가져 오는 경향이 있으며 Gauge를 사용하여 테스트를 수행하기위한 것입니다.
테스트를 실행할 때 ChromeDriver에 대한 새 인스턴스를 만들려고 할 때 오류가 발생합니다. 여기
는 예외입니다 :Error Message: java.lang.NoSuchMethodError: com.google.common.util.concurrent.SimpleTimeLimiter.create(Ljava/util/concurrent/ExecutorService;)Lcom/google/common/util/concurrent/SimpleTimeLimiter;
Stacktrace:
org.openqa.selenium.net.UrlChecker.<init>(UrlChecker.java:64)
org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:187)
org.openqa.selenium.remote.service.DriverService.start(DriverService.java:178)
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:78)
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:646)
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:255)
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:237)
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:138)
org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:178)
org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:167)
org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)
StepTests.setupTest(StepTests.java:26)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.thoughtworks.gauge.execution.MethodExecutor.execute(MethodExecutor.java:38)
com.thoughtworks.gauge.execution.HooksExecutor$TaggedHookExecutor.executeHook(HooksExecutor.java:102)
com.thoughtworks.gauge.execution.HooksExecutor$TaggedHookExecutor.execute(HooksExecutor.java:88)
com.thoughtworks.gauge.execution.HooksExecutor.execute(HooksExecutor.java:45)
com.thoughtworks.gauge.processor.MethodExecutionMessageProcessor.executeHooks(MethodExecutionMessageProcessor.java:65)
com.thoughtworks.gauge.processor.SpecExecutionStartingProcessor.process(SpecExecutionStartingProcessor.java:32)
com.thoughtworks.gauge.connection.MessageDispatcher.dispatchMessages(MessageDispatcher.java:89)
com.thoughtworks.gauge.GaugeRuntime.dispatchMessages(GaugeRuntime.java:104)
com.thoughtworks.gauge.GaugeRuntime.access$100(GaugeRuntime.java:36)
com.thoughtworks.gauge.GaugeRuntime$2.run(GaugeRuntime.java:85)
java.lang.Thread.run(Unknown Source)
이 코드를 실행 : 더 당신이 해결책을 찾기 위해 알아야 할 무언가가있는 경우
import com.thoughtworks.gauge.*;
import io.github.bonigarcia.wdm.ChromeDriverManager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import com.thoughtworks.gauge.Step;
import static org.junit.Assert.assertEquals;
public class StepTests {
//Holds the WebDriver instance
private WebDriver webDriver;
@BeforeSuite
public static void initializeDriver(){
ChromeDriverManager.getInstance().setup();
}
@BeforeSpec
public void setupTest(){
webDriver = new ChromeDriver();
}
--test code--
@AfterSuite
public void closeDriver(){
if (webDriver != null) {
webDriver.quit();
}
}
}
저에게 알려주세요.
이것이 도움이되는 경우 Guava의 현재 버전은 guava-21.0.jar입니다. – Travsam
그 동안 해결할 수있는 방법이 있습니까? 미리 감사드립니다. – Travsam