iphone - UI iOS 自动化 : I want to background the app and click the settings panel to put the phone into airplane mode to test the apps offline behaviour

标签 iphone instruments offline-mode ios-ui-automation airplane-mode

我正在尝试将 iOS 自动设置为飞行模式,但我不知道如何访问设置面板来执行此操作。

我尝试了以下方法,以便能够查看应用程序在后台时是否列出设置面板,以便能够知道访问设置的内容:

target.deactivateAppForDuration(10); window.logElementTree();

但是,这只是将应用程序置于后台十秒钟,然后列出应用程序窗口中的元素。

关于如何访问设置面板以打开飞行模式有什么想法吗?

提前致谢

最佳答案

我认为除了您正在测试的应用程序之外,不可能操纵其他应用程序。您可能会考虑创建一个 UIButton #if DEBUGActivate airplane mode programmatically?然后,使用 UI 自动化点击该按钮。

关于iphone - UI iOS 自动化 : I want to background the app and click the settings panel to put the phone into airplane mode to test the apps offline behaviour,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5728951/

相关文章:

iphone - 类扩展 - 无法识别的二传手

iphone - iOS 应用程序 UI 自动化测试的最佳资源

python - 如何在 python 中使用 Plotly 离线模式绘制条形图?

java - 使用 Java 在 Mac 上启动 Minecraft

ios - SKMaps 关注者用户位置 离线模式 iOS 8 beta

iphone - 如何在 iphone 的表格单元格内显示多行文本?

iphone - Coredata关系实体创建

iphone - -[CALayer释放] : message sent to deallocated instance

iOS 分配 - heapshots 中的持久计数并不总是 0

iphone - 为什么仪器报告泄漏,而其引用计数却变为零