wkwebview中添加的自定义视图在Uitesting期间未列出
我有一个带有以下视图层次结构的Uitable视图。
UIViewController
|--UITableView
|--WKWebview
|--ScrollView
|--UIView
uiview
完成WebView负载后,将添加,并且视图正确出现在UI中。 当我运行Uitestcases时,在uitesting
中未列出动态添加的内容。
下面的方法是尝试的,并且不起作用。
- SET
InscoscessibilityElement
对上述层次结构中的所有视图false - print
app.debugdescription
未显示新添加的视图内容 - 。此外,在此也未显示新添加的视图内容,
- 添加了
conseviencyIdendifier
不列出新添加的内容
不确定这是预期的行为还是我在添加内容时做错了什么。
子视图代码:
[tableViewCell.webView.scrollView addSubview:customView]
帮助赞赏
I have a UITableview with the below view hierarchy.
UIViewController
|--UITableView
|--WKWebview
|--ScrollView
|--UIView
The UIView
is added once the Webview load is completed and the view appeared properly in the UI.
When I run the UITestcases the dynamically added content is not listed during the UITesting
.
The below approaches are tried and didn't work.
- Set
isAccessibilityElement
false to all the views in the mentioned hierarchy - print the
app.debugDescription
the newly added view contents are not displayed - print the
XCUIApplication()
and here also the newly added view contents are not displayed - added the
accessibilityIdentifier
to all the views the newly added contents are not listed
Not sure whether this is expected behavior or am I doing something wrong here in adding the contents.
Subview code:
[tableViewCell.webView.scrollView addSubview:customView]
Help Appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过将自定义视图添加到可访问性元素列表中来解决问题。
The issue is fixed by adding the custom view to the accessibility elements list.