加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

iphone – 尝试使用UI自动化在UITableViewCell中点击UIButton失

发布时间:2020-12-15 01:59:33 所属栏目:百科 来源:网络整理
导读:我有一个iPhone应用程序,我正在使用UI自动化测试。 我在UITableViewCell中有一个按钮,但是当我尝试使用UI Automation点击它时,会得到以下错误。 Script threw an uncaught JavaScript error: target.frontMostApp().mainWindow().scrollViews()[0].elemen
我有一个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

我已经在Interface Builder中的按钮上启用了辅助功能,并分配了辅助功能标签(和标识符)“detailsButton”。我可以检索按钮元素,并验证它是否有效。由于某种原因我根本无法利用它

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

解决方法

您可以分配UIButton,除了使用round rect按钮。您还可以在控制器类中设置表视图委托方法的目标操作。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读