简体   繁体   中英

Unable to start Java-client 1.5.0 NoSuchMethodException

I have got a problem with new java-client 1.5.0 and Appium 1.1.0. When I want to run tests, it wrote:

*** 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)
...

my Driver.setup method looks like this:

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

That NoSuchMethodError is pointing at Driver line 39 which is:

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

Have you got any idea where could be a problem? Documentation is not much helpful. Thank you.

Yes I solved it. I found in documentation, that new java-client 1.5.0 depends on selenium 2.42.2 but in my pom.xml was selenium 2.41.0. After upgrading, everything seems to be ok.

NoSuchMethodError通常是由于使用与构建应用程序不同的版本的插件或库导致的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM