【问题标题】:Appium iOS tests not runningAppium iOS 测试未运行
【发布时间】:2013-10-31 16:17:57
【问题描述】:

我正在尝试使用 appium 设置自动化测试环境,但是遇到了麻烦。我看到的问题是 appium 正在提取包含 .app 目录的 zip,但随后声称它找不到 .app。我的平台是mac。确切的错误如下:

info: Unzipping /var/folders/0s/0kz_6kb13f35wxwjxkff9sdw0000gn/T/appium-app113922-2258-1ap6o7i.zip
info: Testing zip archive: /var/folders/0s/0kz_6kb13f35wxwjxkff9sdw0000gn/T/appium-app113922-2258-1ap6o7i.zip
info: Zip archive tested clean
info: Unzip successful
info: Got configuration error, not starting session
error: Failed to start an Appium session, err was: App zip unzipped OK, but we couldn't find a .app bundle in it. Make sure your archive contains the .app package and nothing else
info: Responding to client with error: {"status":6,"value":{"message":"A session is either terminated or not started","origValue":"App zip unzipped OK, but we couldn't find a .app bundle in it. Make sure your archive contains the .app package and nothing else"},"sessionId":null}

我不确定我的代码是否做错了,下面是我的 setup() 方法的内容(基本上是从官方示例中复制的)。

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("device", "8b0949a1d3fe5d7283cc46ca5470acd67d6c5d7b");
File app = new File("/Users/user/path/to/zip");
capabilities.setCapability("version", "7.0");
capabilities.setCapability("app", app.getAbsolutePath());
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),
            capabilities);
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

【问题讨论】:

    标签: ios testing webdriver automated-tests appium


    【解决方案1】:

    需要考虑的事项:

    1. 您的 .zip 应仅包含 .app
    2. .app 应使用与设备 (iPhone) 上使用的相同开发证书在 XCode 中构建

    对我来说,它是这样工作的:我从 XCode 中的源代码构建了一个 .app 并上传到设备。然后在 Appium 中我只是指定了应用程序的 Bundle ID(如果我没记错的话,在 XCode Window>Organizer>Apps 中)。

    【讨论】:

      【解决方案2】:

      对于任何有类似问题的人:我通过指定 .app 文件解决了这个问题,但在运行 appium 时在命令行而不是在测试代码中指定了设备的 UDID。我认为指定“设备”功能会导致错误(可能让 appium 认为它是 android 测试,尽管写出它正在寻找 .app)

      【讨论】:

        猜你喜欢
        • 2016-05-16
        • 2017-07-07
        • 2014-04-05
        • 2016-08-03
        • 2015-05-27
        • 2017-11-07
        • 1970-01-01
        • 2014-02-11
        • 1970-01-01
        相关资源
        最近更新 更多