如何继续测试iOS应用程序,使用UIAutomation仪器,甚至应用程序退出后? [英] How to continue testing an iOS app, using UIAutomation instrument, even after the app exits?

查看:208
本文介绍了如何继续测试iOS应用程序,使用UIAutomation仪器,甚至应用程序退出后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序。有一个在应用程序,而如果点击后,退出应用程序的按钮。我测试用的仪器UIAutomation应用。我想测试一下这个按钮。但是,应用程序退出后,仪器停止给一个例外。我想要做的是该应用程序存在后,我要重新打开应用程序,并继续进行试验的其余部分。有其他人一直在相同的情况下?如果是的话,可以请你分享的解决方案,如果你发现有任何?

I have an app. There is a button in the app, which, if clicked, exits the app. I am testing the app using UIAutomation instruments. I want to test this button. But after the app exits, the instrument stops giving an exception. What I want to do is that after the app exists, I want to reopen the app and continue with the rest of the test. Have anyone else been in the same scenario? If so, can you please share the solution, if you have found any?

推荐答案

这是不可能的,因为乐器失去与应用过程中一旦它退出的连接。

This is not possible because Instruments loses the connection with the app process once it quits.

如果您通过命令行脚本UI自动化,你可以第一个退出该应用程序,然后检查,以确保一切是复位后运行自动化第二脚本。

If you are scripting UI Automation from the command line, you can run a second automation script after the first one quits the app that then checks to make sure everything is reset.

instruments \
    -D [trace document] \
    -t [instruments template] \
    /path/to/Bundle.app \
    -e UIARESULTSPATH [directory to store test output] \
    -e UIASCRIPT reset_the_app.js

instruments \
    -D [trace document] \
    -t [instruments template] \
    /path/to/Bundle.app \
    -e UIARESULTSPATH [directory to store test output] \
    -e UIASCRIPT check_that_the_app_is_reset.js

因此​​,而不是试图让仪器的同一个实例来重新启动并重新连接到应用程序,只需要运行两个独立的脚本,一个没有你的复位和中止,以及检查所导致的应用程序的状态,其他

So, rather than trying to get the same instance of Instruments to relaunch and reattach to the app, just run two separate scripts, one that does your reset-and-abort, and the other that checks the resulting state of the app.

这篇关于如何继续测试iOS应用程序,使用UIAutomation仪器,甚至应用程序退出后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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