线程" main"中的例外情况org.openqa.selenium.WebDriverException:处理命令

时间:2018-01-12 05:42:29

标签: ios selenium-webdriver automation xcuitest

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

Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the 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         at java.base / jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native   方法)         at java.base / jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)         at 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)         at java.base / java.util.stream.ReferencePipeline $ 3 $ 1.accept(ReferencePipeline.java:195)         at java.base / java.util.Spliterators $ ArraySpliterator.tryAdvance(Spliterators.java:958)         在java.base / java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)         at java.base / java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)         在java.base / java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)         at java.base / java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)         at 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)         at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)         at 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]错误:无法安装app命令' ios-deploy --id ...退出代码为253

有任何建议或帮助吗?

1 个答案:

答案 0 :(得分:0)

看起来您正在尝试将模拟器构建安装到真实设备上。您需要构建要测试的设备的正确架构,然后更新MobileCapabilityType.APP值以进行匹配。类似的东西:

“/用户/.../的Xcode / DerivedData / WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs /建造/产品/的调试-的iPhoneOS /IntegrationApp.app”);

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