使用 Appium 自动化 iOS 8 应用程序导致应用程序冻结 [英] Automating iOS 8 app with Appium causes app freeze

查看:37
本文介绍了使用 Appium 自动化 iOS 8 应用程序导致应用程序冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用 Appium 运行自动化测试的应用.我们可以通过 Appium 在设备和模拟器上启动应用程序.但是,在 Appium 发送 2-3 个点击命令后,应用程序挂起并冻结.冻结后,Appium 在屏幕上找不到任何其他元素.

We have an app that we run automation tests on with Appium. We can launch the app on the device and simulator through Appium. However, the app hangs and freezes after Appium sends 2-3 tap commands. After the freeze, Appium can not find any other elements on the screen.

我们考虑使用 Xcode 6.0.1 Instruments 编写测试脚本,但是当脚本运行时,应用程序也会挂起.

We looked into writing a test script using Xcode 6.0.1 Instruments, but when the script is run, the app hangs as well.

应用在手动测试时按预期运行.只有当我们尝试使用 Appium 或 Xcode 的 Instruments 对其运行自动化时,它才会挂起.我们使用的是 Appium v​​1.3.0-beta1 和 Xcode 6.0.1.

The app performs as expected when testing manually. It only hangs when we try to run automation on it either with Appium or with Xcode's Instruments. We are using Appium v1.3.0-beta1, and Xcode 6.0.1.

这似乎是一个与这个问题类似的问题,但我们的测试设备已经在 8.0.2 上.

This seems to be a similar issue to this question, but our test device is already on 8.0.2.

推荐答案

因此,在 iOS 8 中,记录过多数据(尤其是在记录 API 响应时)会导致自动化期间出现竞争条件.我们能够通过从应用中禁用日志记录来解决我们的自动化冻结问题.

So it turns out that with iOS 8, logging too much data (particularly the case when you're logging API responses) can cause a race condition during Automation. We were able to solve our automation freezing issues by disabling logging from the app.

由于@tbao 对这篇文章的精彩分析,找到了解决方案:https://discuss.appium.io/t/app-freezes-when-automated/1030/8

The solution was discovered thanks to the wonderful analysis by @tbao on this post: https://discuss.appium.io/t/app-freezes-when-automated/1030/8

这篇关于使用 Appium 自动化 iOS 8 应用程序导致应用程序冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆