UIAutomation, UITableView inside UITableViewCell

二次信任 提交于 2019-12-11 11:42:15

问题


I have a horribly coded set of controllers which I am unable to refactor at this time. I need to bring them under automated testing, but have run into an issue with the UIAutomation tool.

These controllers are dynamically generated. There were many ways to do this but somebody decided it would be best if they made a tableview containing cells which each contain more tableviews, containing the cells that the user will see and interact with.

A simple example of one of these controllers is as follows:

I need to press one of those table view cells automagically.

After struggling with some view hierarchy issues, I finally managed to get the logElementTree to see all of the cells, with correct accessibility identifiers. Here is the result:

Now just to test that I can press one of the buttons from a script...

NOPE. I can't seem to drill down into the elements even though the logTree clearly shows they exist and are visible.

Any ideas very welcome. I'm not very experienced with javascript so I could be missing something obvious. Thanks!


回答1:


To answer my own question and thanks to a helpful engineer at the WWDC:

target.frontMostApp().mainWindow().tableViews()[0].cells()[0].tableViews()[0].cells()["Open"].tap();


来源:https://stackoverflow.com/questions/11022166/uiautomation-uitableview-inside-uitableviewcell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!