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
isAccessibilityElementfalse to all the views in the mentioned hierarchy - print the
app.debugDescriptionthe newly added view contents are not displayed - print the
XCUIApplication()and here also the newly added view contents are not displayed - added the
accessibilityIdentifierto 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
CodePudding user response:
The issue is fixed by adding the custom view to the accessibility elements list.
[self.view setAccessibilityElements:@[customView]];
