UI iOS 自动化:我想要将应用程序置于后台,然后单击设置面板将手机置于飞行模式以测试应用程序的离线行为
我正在尝试将 iOS 自动设置为飞行模式,但我不知道如何访问设置面板来执行此操作。
我尝试了以下方法,以便能够查看应用程序在后台时是否列出设置面板,以便能够了解访问设置的内容:
target.deactivateAppForDuration(10); window.logElementTree();
但是,这只会将应用程序置于后台十秒钟,然后在应用程序窗口中列出元素。
关于如何访问设置面板以打开飞行模式有什么想法吗?
提前致谢
I'm trying to automate setting the iOS into airplane mode, but I don't know how to access the settings panel to do so.
I have tried the following to be able to see if the settings panel is listed when the app is in the background so as to be able to know what it is to access the settings:
target.deactivateAppForDuration(10);
window.logElementTree();
HOWEVER, this just puts the App in the background for ten seconds and then lists the elements in the App window.
Any ideas on how to to access the settings panel to turn on airplane mode?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为除了您正在测试的应用程序之外,不可能操纵其他应用程序。您可以考虑创建一个
UIButton
#if DEBUG
到 以编程方式激活飞行模式? 然后,使用 UI 自动化点击该按钮。I don't think this it's possible to manipulate other apps than the one you're testing. You might consider creating a
UIButton
#if DEBUG
to Activate airplane mode programmatically? Then, use UI Automation to tap that button.