UIAutomation,UITableViewCell内的UITableView [英] UIAutomation, UITableView inside UITableViewCell

查看:74
本文介绍了UIAutomation,UITableViewCell内的UITableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组可怕的控制器,目前无法重构.我需要对它们进行自动测试,但是UIAutomation工具遇到了问题.

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.

在解决了一些视图层次结构问题之后,我最终设法获得了logElementTree来查看所有具有正确可访问性标识符的单元格.结果如下:

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.即使logTree清楚地显示了这些元素的存在和可见,我似乎也无法对其进行深入研究.

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

任何想法都非常欢迎.我对javascript不太有经验,所以我可能会遗漏一些明显的东西.谢谢!

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

推荐答案

要回答我自己的问题,并感谢WWDC的一位乐于助人的工程师:

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();

这篇关于UIAutomation,UITableViewCell内的UITableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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