我在使用新的Java客户端1.5.0和Appium 1.1.0时遇到问题。当我想运行测试时,它写道:

*** RUN ABORTED ***
java.lang.NoSuchMethodError: org.openqa.selenium.remote.ErrorHandler.<init>           (Lorg/openqa/selenium/remote/ErrorCodes;Z)V
at io.appium.java_client.AppiumDriver.<clinit>(AppiumDriver.java:38)
at po.Driver$.setup(Driver.scala:39)
at src.test.BaseTest.startTestWithLogin(BaseTest.scala:42)
at zzzPokus.NaZkousku$$anonfun$1.apply$mcV$sp(NaZkousku.scala:23)
at zzzPokus.NaZkousku$$anonfun$1.apply(NaZkousku.scala:23)
at zzzPokus.NaZkousku$$anonfun$1.apply(NaZkousku.scala:23)
at org.scalatest.BeforeAndAfter$class.runTest(BeforeAndAfter.scala:195)
at src.test.BaseTest.runTest(BaseTest.scala:13)
at org.scalatest.FeatureSpecLike$$anonfun$runTests$1.apply(FeatureSpecLike.scala:259)
at org.scalatest.FeatureSpecLike$$anonfun$runTests$1.apply(FeatureSpecLike.scala:259)
...


我的Driver.setup方法看起来像这样:

def setup {
val caps: DesiredCapabilities = new DesiredCapabilities
caps.setCapability(MobileCapabilityType.APP_PACKAGE, "cz.tipsport.bet")
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android")
caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, "4.2.2")
caps.setCapability(MobileCapabilityType.APP_ACTIVITY, "cz.tipsport.bet.gui.SplashScreenActivity")
caps.setCapability(MobileCapabilityType.APP, """I:/testing/Mobil/Android/test/tipsport_test.apk""")
driver = new AppiumDriver(new URL("http://localhost:4723/wd/hub"), caps)
}


NoSuchMethodError指向驱动程序第39行,即:

driver = new AppiumDriver(new URL("http://localhost:4723/wd/hub"), caps)


您知道哪里可能有问题吗?文档没有太大帮助。谢谢。

最佳答案

是的,我解决了。我在文档中发现,新的Java客户端1.5.0依赖于硒2.42.2,但在我的pom.xml中是硒2.41.0。升级后,一切似乎都还可以。

10-08 19:29