我是iPhone Automation的新手,也是iOS4推出的UIAutomation框架.最近我使用UIAutomation通过仪器在iPhone模拟器上自动测试应用程序,但它给我一个错误,如"[UIATarget_0x5a20d20 frontMostApp]中的意外错误,/ SourceCache/UIAutomation_Sim/UIAutomation-37/Framework/OUATargetElements.m第437行"
我也尝试过用iOS4更新后在iPhone 3G设备上运行应用程序.但仪器向我显示警告"此设备不支持自动化".
我的问题是,UIAutomation是否可以在模拟器上运行?我是否需要购买3GS或iPhone 4.0等新设备才能运行?提前致谢...
当我使用for循环时,调用UIATarget.localTarget().frontMostApp().mainWindow().elements(); 要搜索主视图上的特定元素,它运行速度非常慢.有没有人遇到过这个问题呢?如果是这样,任何提糖
我是IOS编程的新手.我有一个任务是找到我是否可以自动化我的UI进行测试.这就是我想要做的:
在我的应用程序中随机放置一些代码(听起来不好但可能是预定义的事件)将事件消息发送到屏幕上的控件.
由于它只是代码,我应该能够使用该应用程序,将其部署在任何iPhone或iPad中并运行该程序.
一旦应用程序通过我的代码完全自动化,我想可以很容易地对获得的性能数据进行分析.
我见过FoneMonkey,但看起来需要在每台设备上手动记录用户交互.
欢迎任何想法或建议.
我正在寻找一种开发工具,它允许我将随机生成的用户输入(触摸,硬键,手势)发送到iOS设备(不是模拟器),如Android上的Monkey.
我发现我不能这样做UIAPickerWheel.selectValue(),任何想法?
在IOS Simulator 5.1中,此代码有效:
`instruments -t /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /Users/administrator/Library/Application\ Support/iPhone\ Simulator/6.0/Applications/$numbersstrings/myapp.app/ -e UIASCRIPT /Users/administrator/Desktop/Tests/smoke.js`
Run Code Online (Sandbox Code Playgroud)
xcode更新后,ios simulator 6.0此代码不起作用并显示此错误:
`Instruments Usage Error : The specified template 'file://localhost/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate' does not exist.`
Run Code Online (Sandbox Code Playgroud)
文件夹:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library不包含文件夹/乐器.
在哪里找到它?
我有一个有视图的xib文件.在一个视图下,我有很少的标签......我正在开发UIAutomation,因此想要为视图和每个标签添加辅助功能标识符.我怎么能在xib中做到这一点?我用Google搜索并发现应该使用名为"identifier"的字段...但我看不到任何视图和标签的字段.
请建议.
我跟着这个网站开始使用UI自动化. http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation#1.2
我试图从命令行启动Instruments.不幸的是我收到一个错误:
2013-03-14 14:06:36.376 instruments[17854:1207] Connection to the remote device lost while launching target. Aborting...
2013-03-14 14:06:36.378 instruments[17854:1207] Recording cancelled : At least one target failed to launch; aborting run
Instruments Trace Error : Failed to start trace.
Run Code Online (Sandbox Code Playgroud)
这是我使用的命令:
instruments -w {deviceId} -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate {appname} -e UIASCRIPT /Path/to/Script.js
目前我正在使用Xcode 4.6.
有一些有用的教程,你可以建议吗?我学习了如何使用Emulator编写和运行测试,但无法理解如何在真正的iOS设备上运行(我在代码中提供的内容,应该如何正确运行Appium服务器等).
从命令行运行UIAutomation测试似乎经常在新的Xcode版本中破坏(根据过去的帖子判断).从未使用过命令行脚本,我从2012年发现了这篇文章:来自命令行的自动化仪器.
问题:我的命令返回没有错误,没有输出结果,没有任何记录到系统控制台.模拟器甚至没有启动!
检查一些更新路径(特别是自动跟踪仪器路径),我想出了这个命令.注意第一个参数中的路径(它与过去的Xcode版本不同):
instruments -t "/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate"
"/Users/sohail/Library/Developer/CoreSimulator/Devices/7232A640-A9D2-4626-A2AD-37AFFF706718/data/Containers/Bundle/Application/D07FEC4B-76AD-4844-8362-08E771B81053/MyAppName.app"
-e UIASCRIPT "/Users/sohail/source/MyAppName/MyAppNameAutomationTests/TestRunner.js"
-e UIARESULTSPATH "Users/sohail/source/MyAppName/MyAppNameAutomationTests/TestResults"
Run Code Online (Sandbox Code Playgroud)
通过从这个要点中选择"原始",这可能更容易阅读.
当然:
TestRunner.js我指定的上述文件可以在指定的路径中找到,并且可以使用Instruments应用程序以交互方式在Automation Instrument中成功运行.想什么?
ios ×5
instruments ×4
iphone ×4
command-line ×2
appium ×1
automation ×1
ios4 ×1
ios8 ×1
objective-c ×1
sdk ×1
testing ×1
xcode ×1
xcode4.5 ×1
xcode6gm ×1