Попытка запустить файл функции Cucumber и получение ошибки - PullRequest
0 голосов
/ 27 мая 2020

Я использую Eclipse в качестве своей IDE и экспериментирую с проектами maven.

Полная ошибка:

java .lang.AbstractMethodError: Receiver class org.openqa .selenium. chrome .ChromeDriverService $ Builder не определяет и не наследует реализацию решенного метода 'abstract org.openqa.selenium.remote.service.DriverService createDriverService (java .io.File, int, com.google. common.collect.ImmutableList, com.google.common.collect.ImmutableMap) 'абстрактного класса org.openqa.selenium.remote.service.DriverService $ Builder.

Это мой POM. xml file:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>ah</groupId>
  <artifactId>cucumberParallel</artifactId>
  <version>0.0.1-SNAPSHOT</version>

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

        <!-- selenium-chrome-driver -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-chrome-driver</artifactId>
            <version>4.0.0-alpha-5</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>5.7.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>5.7.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-core</artifactId>
            <version>5.7.0</version>
        </dependency>
    </dependencies>
</project>

Это блок кода, вызывающий ошибку:

System.setProperty("web.chrome.driver", "C:\\Users\\xavier\\eclipse-workspace\\cucumberParallel\\chromedriver.exe");
driver = new ChromeDriver();

Edit : Я исправил проблему, удалив все зависимости из pom. xml и добавляя вещи по очереди. Вот как выглядит новый файл pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>ah</groupId>
  <artifactId>cucumberParallel</artifactId>
  <version>0.0.1-SNAPSHOT</version>

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

        <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>5.7.0</version>
        </dependency>
    </dependencies>
</project>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...