我遇到了新的 java-client 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)
你知道哪里有问题吗?文档没有太大帮助。谢谢你。