我正在尝试在 AWS 设备群 iOS 设备上使用 Java、Selenium 和 Appium 运行自动化测试用例我收到 NoSuchMethodError

问题描述

这是我在 AWS iOS 设备上运行代码时遇到的错误。相同的代码在 Android 设备上运行良好 安卓 AWS iOS 设备 看不到 WDA 安装

 [TestNG] java.lang.NoSuchMethodError: com.google.common.base.Throwables.throwIfUnchecked(Ljava/lang/Throwable;)V
    [TestNG]    at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:253)
    [TestNG]    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
    [TestNG]    at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41)
    [TestNG]    at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
    [TestNG]    at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
    [TestNG]    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
    [TestNG]    at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:336)
    [TestNG]    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
    [TestNG]    at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:37)
    [TestNG]    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:88)
    [TestNG]    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:98)
    [TestNG]    at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:90)
    [TestNG]    at utilities.awsDeviceFarmUtils.launchAppSub_AWS(awsDeviceFarmUtils.java:311)
    [TestNG]    at utilities.awsDeviceFarmUtils.launchApp_ExistingUser(awsDeviceFarmUtils.java:32)
    [TestNG]    at localTests.sampleTest.sampleTest(sampleTest.java:234)
    [TestNG]    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [TestNG]    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [TestNG]    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [TestNG]    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    [TestNG]    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
    [TestNG]    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
    [TestNG]    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    [TestNG]    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    [TestNG]    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    [TestNG]    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    [TestNG]    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    [TestNG]    at org.testng.TestRunner.run(TestRunner.java:617)
    [TestNG]    at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
    [TestNG]    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
    [TestNG]    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
    [TestNG]    at org.testng.SuiteRunner.run(SuiteRunner.java:254)
    [TestNG]    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    [TestNG]    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    [TestNG]    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    [TestNG]    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    [TestNG]    at org.testng.TestNG.run(TestNG.java:1057)
    [TestNG]    at org.testng.TestNG.privateMain(TestNG.java:1364)
    [TestNG]    at org.testng.TestNG.main(TestNG.java:1333)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)