尝试使用UI自动化在UITableViewCell中点击UIButton失败,"无法点击"

kod*_*die 17 iphone xcode instruments ui-automation ios

我有一个iPhone应用程序,我正在使用UI自动化进行测试.

我有一个按钮,UITableViewCell但是当我尝试使用UI Automation点击它时,我收到以下错误.

Script threw an uncaught JavaScript error: target.frontMostApp().mainWindow().scrollViews()[0].elements()[element_name].tableViews()[0].elements().firstWithPredicate(name contains[c] 'Brooklyn').elements()["detailsButton"] could not be tapped
Run Code Online (Sandbox Code Playgroud)

我已在Interface Builder中的按钮上启用了辅助功能,并为其分配了辅助功能标签(和标识符)"detailsButton".我可以检索按钮元素并验证它是否有效.我出于某种原因无法点击它.

UIATableCell布鲁克林

UIButton是一个圆形矩形按钮,启用了用户交互.感谢您的任何反馈.

Wis*_*ish 1

您可以UIButton使用圆形矩形按钮分配除外。您还可以在存在表视图委托方法的控制器类中设置按钮的目标操作。