Appium Java客户端版本与Selenium版本

时间:2018-07-19 06:53:00

标签: java selenium selenium-webdriver appium appium-android

任何人都可以告诉我如何确保哪个appium java-client jar版本与哪个硒jar版本兼容。我尝试了许多不同的appium java-client版本和硒版本,并且遇到了以下问题:-

  1. org.openqa.selenium.remote.RemoteWebElement cannot be cast to io.appium.java_client.android.AndroidElement with java-client 4.1.2 ans selenium 3.9.1
  2. java.lang.NullPointerException with java-client 4.1.0 ans selenium 3.9.1
  3. java.lang.NoSuchMethodError with java-client 6.0.0 ans selenium 3.13.0
  4. java.lang.NoClassDefFoundError with java-client 6.0.0 ans selenium 3.9.1

列表很长。

我尝试了很多事情,最终通过Java-client 2.1.0selenium version 2.45.0

对我有用

这些是旧版本,我想使用一次新版本。 有没有办法找出哪个Java客户端版本与哪个Selenium版本完美配合?

有没有链接或列表,而不是尝试所有排列组合?

5 个答案:

答案 0 :(得分:2)

您可以按照Appium news部分获取有关硒-Java相关依赖的更新。

示例: 要了解Java-Client 5.0.2版本并了解其依赖性,请访问下面的链接

Java-client-5-0-2

您将找到类似的更新

Release update and changes

答案 1 :(得分:0)

嗨,您可以使用以下版本:

<dependencies>
        <!-- https://mvnrepository.com/artifact/io.appium/java-client -->
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>6.0.0-BETA5</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-server -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>3.9.1</version>
        </dependency>
</dependencies>

即使遇到了此类问题,经过几次排列后,上述版本对我也可以正常工作。

答案 2 :(得分:0)

我对此的猜测是您可能会遇到环境问题。如果您不太方便,请同时使用Selenium和Appium的最新驱动程序。

我在您的previous question中写道,您可以使用例如。这种环境:

如果仍然有问题,请尝试使用该appium工具appium-doctor。

使用appium-doctor验证设置

安装后,我们可以运行appium-doctor来验证设置:

router interface
         address 10.10.10.10/24 

blah
         this is my MAC - XX:YY:ZZ:AA:BB:CC

...
...
...

所有设置的绿色复选标记表示我们可以开始下一章-从源代码执行现有的appium演示。

您还可以在appium GUI工具中使用appium-doctor来验证会话。

如果您没有安装它:

appium-doctor

然后按照以下命令检查您的设置

(android)

npm install appium-doctor -g

(ios)

appium-doctor -- android

希望这会有所帮助,

答案 3 :(得分:0)

我了解了

    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>4.1.2</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>3.1.0</version>
    </dependency>

在Selenium Server抱怨一种所需功能之前: waitForQuiescence。 当我在本地运行相同的测试时,“ waitForQuiscene”没有问题

答案 4 :(得分:0)

在Maven存储库中,您可以看到必要的Selenium版本:

https://mvnrepository.com/artifact/io.appium/java-client/7.1.0