简体   繁体   English

收到错误“org/openqa/selenium/interactions/HasInputDevices”

[英]Getting error "org/openqa/selenium/interactions/HasInputDevices"

I am trying to build a java framework for Appium.我正在尝试为 Appium 构建一个 java 框架。 When I run the tests I get following error:当我运行测试时,出现以下错误:

java.lang.NoClassDefFoundError: org/openqa/selenium/interactions/HasInputDevices java.lang.NoClassDefFoundError: org/openqa/selenium/interactions/HasInputDevices

I have not added any additional selenium dependency at all.我根本没有添加任何额外的硒依赖。 Even if I add selenium-java this error still persists.即使我添加 selenium-java 这个错误仍然存​​在。 Below is my pom.xml and runner file:下面是我的 pom.xml 和 runner 文件:

<properties>
    <maven.compiler.source>16</maven.compiler.source>
    <maven.compiler.target>16</maven.compiler.target>
    <serenity.version>3.2.5</serenity.version>
    <serenity.cucumber.version>3.2.5</serenity.cucumber.version>
    <cucumber.version>7.3.3</cucumber.version>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>net.serenity-bdd.maven.plugins</groupId>
            <artifactId>serenity-maven-plugin</artifactId>
            <version>${serenity.version}</version>
            <executions>
                <execution>
                    <id>serenity-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<dependencies>

    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-cucumber</artifactId>
        <version>${serenity.version}</version>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2</version>
    </dependency>

    <dependency>
        <groupId>org.jeasy</groupId>
        <artifactId>easy-random-core</artifactId>
        <version>5.0.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>5.2.2</version>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.17.2</version>
    </dependency>

    <dependency>
        <groupId>com.googlecode.json-simple</groupId>
        <artifactId>json-simple</artifactId>
        <version>1.1.1</version>
    </dependency>

    <dependency>
        <groupId>com.github.javafaker</groupId>
        <artifactId>javafaker</artifactId>
        <version>1.0.2</version>
    </dependency>

    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>8.1.1</version>
    </dependency>

</dependencies>

Runner:亚军:

import io.cucumber.junit.CucumberOptions;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
    features = {"src/test/resources/features"},
    glue = {"steps"},
    tags = "@appiumApp and not @ignore",
    stepNotifications = true,
    plugin = {
            "json:target/cucumber-report/cucumber.json"
    }
 )
 public class TestRunner {
 }

The above problem was solved by using following combination of dependencies:通过使用以下依赖项组合解决了上述问题:

    <dependencies>

    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-cucumber</artifactId>
        <version>${serenity.version}</version>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2</version>
    </dependency>

    <dependency>
        <groupId>org.jeasy</groupId>
        <artifactId>easy-random-core</artifactId>
        <version>5.0.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>5.2.2</version>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.17.2</version>
    </dependency>

    <dependency>
        <groupId>com.googlecode.json-simple</groupId>
        <artifactId>json-simple</artifactId>
        <version>1.1.1</version>
    </dependency>

    <dependency>
        <groupId>com.github.javafaker</groupId>
        <artifactId>javafaker</artifactId>
        <version>1.0.2</version>
    </dependency>

</dependencies>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “HasInputDevices”位于“/ org / openqa / selenium / interactions”但它仍然在查看“/ org / openqa / selenium /” - “HasInputDevices” is located at “/org/openqa/selenium/interactions” but it is still looking at “/org/openqa/selenium/” 错误:java:找不到org.openqa.selenium.HasInputDevices的org.openqa.selenium.HasInputDevices类文件 - Error: java: cannot access org.openqa.selenium.HasInputDevices class file for org.openqa.selenium.HasInputDevices not found 错误:无法访问 org.openqa.selenium.HasInputDevices,找不到类文件 - Error: cannot access org.openqa.selenium.HasInputDevices, class file not found 获取错误java.lang.NoClassDefFoundError:org / openqa / selenium / interactions / internal / Locableable在com.tests - Getting error java.lang.NoClassDefFoundError: org/openqa/selenium/interactions/internal/Locatable at com.tests Firefox - org.openqa.selenium.interactions.MoveTargetOutOfBoundsException - Firefox - org.openqa.selenium.interactions.MoveTargetOutOfBoundsException 我已经导入了 org.openqa.selenium.interactions.Actions 但仍然抛出错误 Actions can not resolve to a variable - I have imported org.openqa.selenium.interactions.Actions but still throwing error Actions can not resolved to a variable 出现错误:org.openqa.selenium.WebDriverException:元素不可交互 - Getting Error: org.openqa.selenium.WebDriverException: element not interactable 出现错误:无法访问 org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator - Getting error: cannot access org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator java.lang.NoClassDefFoundError: org/openqa/selenium/interactions/internal/Locatable 在 Ubuntu 14.04 上打开浏览器窗口后返回错误 - java.lang.NoClassDefFoundError: org/openqa/selenium/interactions/internal/Locatable error is returned after browser window is opened on Ubuntu 14.04 java.lang.ClassCastException: org.openqa.selenium.firefox.FirefoxDriver cannot be cast to org.openqa.selenium.interactions.HasTouchScreen - java.lang.ClassCastException: org.openqa.selenium.firefox.FirefoxDriver cannot be cast to org.openqa.selenium.interactions.HasTouchScreen
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM