【问题标题】:Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command线程“主”org.openqa.selenium.WebDriverException 中的异常:处理命令时发生未知的服务器端错误
【发布时间】:2018-06-21 13:26:16
【问题描述】:

我是iOS automation 的新手,为此使用Appium 命令行。我已经准备好在真实设备中启动应用程序(集成应用程序)的脚本,每当我在Eclipse 中运行脚本时,运行脚本时都会出现以下错误:

Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command.

原始错误:无法安装应用程序:'Command 'ios-deploy --id f31936d8edc3b8f880254efd02006273e81f5b --bundle /Users/eeposit/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Build/Products/Debug-iphonesimulator/IntegrationApp.app' 以代码 253' 退出(警告:服务器未提供任何 堆栈跟踪信息) 命令持续时间或超时:9.97 秒 构建信息:版本:'3.8.1',修订:'6e95a6684b',时间:'2017-12-01T19:05:14.666Z' 系统信息:主机:'eeposits-Mac-mini-2.local',ip:'192.168.0.106',os.name:'Mac OS X',os.arch:'x86_64',os.version: '10.13.2',java.version:'9.0.1' 驱动信息:driver.version:IOSDriver 在 java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native 方法) 在 java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 在 java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 在 java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488) 在 org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214) 在 org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) 在 org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53) 在 org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91) 在 org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123) 在 java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) 在 java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958) 在 java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127) 在 java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502) 在 java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488) 在 java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) 在 java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) 在 java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 在 java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:476) 在 org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) 在 org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73) 在 org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) 在 io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89) 在 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) 在 io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) 在 io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) 在 io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1) 在 org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219) 在 org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142) 在 io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38) 在 io.appium.java_client.AppiumDriver.(AppiumDriver.java:83) 在 io.appium.java_client.AppiumDriver.(AppiumDriver.java:93) 在 io.appium.java_client.ios.IOSDriver.(IOSDriver.java:78) 在 FirstiOS.iosautomate.main(iosautomate.java:43)

我也成功安装了命令[ npm install -g ios-deploy ],但仍然显示错误。

所以,下面是我添加的功能。

capabilities.setCapability(MobileCapabilityType.APPIUM_VERSION, "1.7.2");
        capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
        capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.3.3");
        capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 5s");
        capabilities.setCapability(MobileCapabilityType.UDID, "f31936d8edc3b8f880254efd02006273e81f5b");
        capabilities.setCapability(MobileCapabilityType.APP, "/Users/eeposit/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Build/Products/Debug-iphonesimulator/IntegrationApp.app");
        capabilities.setCapability("bundleId", "com.facebook.IntegrationApp");
        capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000);
        capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);

请浏览我附在此处的 appium 日志图片:Appium logs

[XCUITest] 错误:无法安装应用命令 'ios-deploy --id...exited with code 253

有什么建议或帮助吗?

【问题讨论】:

    标签: ios selenium-webdriver automation xcuitest


    【解决方案1】:

    您似乎正在尝试将模拟器版本安装到真实设备上。您需要针对要测试的设备的适当架构进行构建,然后更新您的 MobileCapabilityType.APP 值以匹配。比如:

    "/Users/.../Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Build/Products/Debug-iphoneos/IntegrationApp.app");

    Appium 的问题跟踪器here 中详细讨论了此错误消息。

    【讨论】:

    • 哦,是的,这可能是问题所在。对于错误信息,我会关注 appium 的问题跟踪器。谢谢@cbutton9
    • 谢谢,@rshrestha!如果这对您有所帮助,我绝对会感谢“赞成”或“接受”来帮助我建立我的网站声誉。
    • 是的,在使用真实设备构建更新并更新 MobileCapabilityType.APP 路径后,这对我有所帮助。谢谢@cbutton9
    猜你喜欢
    • 2018-07-26
    • 1970-01-01
    • 2017-10-21
    • 2017-01-22
    • 1970-01-01
    • 2016-02-04
    • 2019-01-03
    • 2022-06-29
    • 2020-03-23
    相关资源
    最近更新 更多