是否有用于获取子元素的iOS自动化引用的主列表(即window.buttons())?

时间:2013-06-07 18:20:21

标签: ios cocoa-touch automated-tests ios-ui-automation

我在执行自动化测试时尝试在我的应用中引用搜索栏时遇到困难。 如果我使用类似的东西:

UIATarget.localTarget().frontMostApp().mainWindow().searchBars() 

这似乎不是一个有效的get方法。是否有UIAElements的get方法的主列表(例如.buttons(),. views(),. listViews())或是否有一般规则? UISearchBars的正确get方法是什么?

1 个答案:

答案 0 :(得分:1)

参考文献如下: http://developer.apple.com/library/ios/#documentation/DeveloperTools/Reference/UIAutomationRef/_index.html#//apple_ref/doc/uid/TP40009771

UAISearchBar继承自UIATextFields,因此您可以找到方法'searchBars'。