Ошибка сборки: не удается найти файл класса для org.openqa.selenium.internal.Locatable - PullRequest
0 голосов
/ 15 февраля 2019

Я использую Selenium и Maven для создания проекта в Eclipse и получаю ошибку сборки: не удается найти файл класса для org.openqa.selenium.internal.Locatable.

I'mиспользуя Selenium-Server-Standalone 3.141.59, который, как я заметил, имеет класс Locatable под ...

org.openqa.selenium.**interactions**.Locatable 

вместо ...

org.openqa.selenium.**internal**.Locatable.

Это вообще другой класс?

Как мне заставить Eclipse распознать, что класс существует?

Пожалуйста, найдите следующие мои зависимости от моих Pom.xml

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

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>3.141.59</version>
    </dependency> 

    <dependency>
        <groupId>com.codeborne</groupId>
        <artifactId>selenide</artifactId>
        <version>2.3</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.codeborne/phantomjsdriver -->
    <dependency>
        <groupId>com.codeborne</groupId>
        <artifactId>phantomjsdriver</artifactId>
        <version>1.3.0</version>
    </dependency>               

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

    <!-- https://mvnrepository.com/artifact/log4j/log4j -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

1 Ответ

0 голосов
/ 15 февраля 2019

Удалите Selenium Server из ваших зависимостей.

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-server</artifactId>
    <version>3.141.59</version>
</dependency>

Если я правильно помню, вам теперь нужен WebDriver, который включен в Selenium Java.

Включите также Selenium API

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-api</artifactId>
    <version>3.141.59</version>
</dependency>

и обновление selenide и phantomjsdriver

<dependency>
    <groupId>com.codeborne</groupId>
    <artifactId>selenide</artifactId>
    <version>5.1.0</version>
</dependency>

<dependency>
    <groupId>com.codeborne</groupId>
    <artifactId>phantomjsdriver</artifactId>
    <version>1.4.4</version>
</dependency>

Текущая версия selenide, которую вы вводите, - 2.3, что приведет к selenium-java 2.33.0.

Текущая версия phantomjsdriver, которую вы вводите, составляет 1.3.0, что приведет к selenium-java 2.53.0.

Вам нужно selenide 5.1.0 и phantomjsdriver 1.4.4

...