0

Помогите пожалуйста. Пытаюсь подключить Selenium к мавен проекту и получаю ошибку. Драйвер загрузил и лежит в корне проекта.

Main.java

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Main {
    public static void main(String[] args) throws Exception{
        System.setProperty("webdriver.gecko.driver", "C:\\Users\\Vlad\\IntellijIDEAProjects\\VKParser\\geckodriver.exe");

        WebDriver wd = new FirefoxDriver();
    }
}

Зависимости

    <dependencies>
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.14.3</version>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>LATEST</version>
        </dependency>
    </dependencies>

И ошибка

Exception in thread "main" java.lang.NoSuchMethodError: 'int org.asynchttpclient.config.AsyncHttpClientConfigDefaults.defaultHashedWheelTimerTickDuration()'
    at org.openqa.selenium.remote.http.netty.NettyClient.<clinit>(NettyClient.java:56)
    at org.openqa.selenium.remote.http.netty.NettyClient$Factory.createClient(NettyClient.java:146)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:107)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:94)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:85)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.<init>(DriverCommandExecutor.java:80)
    at org.openqa.selenium.firefox.FirefoxDriver$FirefoxDriverCommandExecutor.<init>(FirefoxDriver.java:142)
    at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:232)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:164)
    at Main.main(Main.java:25)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)

Что делаю не так? Что забыл?

1 ответ 1

0

добавил последнюю версию org.asynchttpclient.async-http-client

<dependency>
    <groupId>org.asynchttpclient</groupId>
    <artifactId>async-http-client</artifactId>
    <version>2.12.3</version>
</dependency>

полетело

Ваш ответ

Нажимая на кнопку «Отправить ответ», вы соглашаетесь с нашими условиями использования и подтверждаете, что прочитали и поняли наши политику конфиденциальности и нормы поведения.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.