【问题标题】:Appium Java Client Version vs Selenium VersionAppium Java 客户端版本与 Selenium 版本
【发布时间】:2018-12-27 04:58:37
【问题描述】:

谁能告诉我如何确定哪个 appium java-client jar 版本与哪个 selenium jar 版本兼容。我尝试了很多不同的 appium java-client 版本以及 selenium 版本,但我遇到了以下问题:-

  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-client 版本与哪个 selenium 版本完美配合?

是否有任何链接可以列出它或其他东西而不是尝试所有排列和组合?

【问题讨论】:

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


    【解决方案1】:

    在 Maven-Repository 中,您可以看到必要的 Selenium 版本:

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

    【讨论】:

      【解决方案2】:

      我可以使用它

          <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 抱怨一项 Desired Capability 之前: 等待静默。 当我对本地运行相同的测试时,“waitForQuiscene”没有问题

      【讨论】:

      • 这并没有回答我的问题,除了下面已经回答了。虽然如果你已经知道版本兼容性,你给出的解决方案是相当不错的。
      【解决方案3】:

      您可以关注Appium news 部分以获取有关 selenium - java 相关依赖项的更新。

      示例: 要了解 Java - Client 5.0.2 版本并了解它的依赖关系,请访问以下链接

      Java-client-5-0-2

      你会发现这样的更新

      【讨论】:

        【解决方案4】:

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

        我写在你的previous question 你可以使用例如。这个环境:

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

        使用 appium-doctor 验证设置

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

        appium-doctor
        

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

        您还可以使用appium GUI工具中的appium-doctor来验证sesstings。

        如果你没有安装它:

        npm install appium-doctor -g
        

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

        (安卓)

        appium-doctor -- android
        

        (ios)

        appium-doctor --ios
        

        希望这会有所帮助,

        【讨论】:

        • 我尝试使用 java 客户端 6.1.0 和 selenium 3.13.0 和 appium 服务器 1.7.1 但它对我不起作用,它给出了 java.lang.NoSuchMethodError: org.openqa.selenium。 json.JsonOutput.write(Ljava/lang/Object;)Lorg/openqa/selenium/json/JsonOutput;错误。服务器版本不是问题,它只是 java-client 和 selenium 之间的版本匹配。
        • 但是我看不出这个错误与版本有关系,它们肯定是兼容的,其他东西似乎在困扰你。版本兼容。从一步一步调试开始,尝试找出问题
        【解决方案5】:

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

        <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>
        

        即使我也遇到过这样的问题,经过几次排列后,上述版本对我来说也很好。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2014-10-11
          • 2017-01-07
          • 2021-06-14
          • 2019-02-15
          • 2017-04-01
          • 2011-08-25
          • 1970-01-01
          • 2013-09-29
          相关资源
          最近更新 更多