简体   繁体   English

iOS UI自动化如何在测试挂起时终止进程

[英]iOS UI automation how to kill the process when test is hang

im Using instrument and javascript to do my automation. 即时通讯使用仪器和JavaScript进行自动化。

any idea how to kill instrument when the test hang? 知道测试挂起时如何杀死仪器吗? i was planning to put a time out in my script so if the time out exceeded it will kill the instrument.. 我打算在脚本中放置一个超时时间,所以如果超时超过它将会杀死该乐器。

any bash cmd to do it? 有什么bash cmd吗?

Did you try something like pkill instruments ? 您尝试过类似pkill instruments东西吗? Unfortunately I don't have a mac to test it. 不幸的是,我没有Mac来测试它。

If you don't have a running process named instruments you can use the top command to find the correct name. 如果没有正在运行的名为文书的进程,则可以使用top命令查找正确的名称。

You can push and pop a timeout on your tests and if it fails, throw an exception. 您可以在测试中推送并弹出超时,如果超时则抛出异常。 The script will stop running and if you're using the command line, everything will stop. 该脚本将停止运行,并且如果您使用命令行,则所有操作都会停止。 Now, if you really want to kill the Instruments process running at the end of the failure; 现在,如果您真的想终止故障结束时正在运行的Instruments进程,请执行以下操作: just put everything on a simple shell script with killall "iPhone Simulator" at the end. 只需将所有内容放到一个简单的shell脚本中,最后用killall“ iPhone Simulator”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM