Hi all:
I create a Custom UIView, named "HeaderView" and add it into a tableView's subview,
and I set the HeaderView's isAccessibilityElement to "NO" and set the HeaderView's subview "SettingBbutton" with accessibilityIdentifier = "settingBtn" and isAccessibilityElement to "YES".
like this:
@implementation TableHeaderView
- (void)awakeFromNib {
[super awakeFromNib];
[self initAccessibility];
}
#pragma mark - Init
- (void)initAccessibility {
self.isAccessibilityElement = NO;
self.SettingBbutton.isAccessibilityElement = YES;
self.SettingBbutton.accessibilityIdentifier = @"settingBtn";
}
@end
When I using voice over, I can find the "settingBtn" well, and using simulator's accessibility inspector also can select the "settingBtn".
But I using XCUIElemenrtQuery to find the button, like:
let app = XCUIApplication()
let tablesQuery = app.tables
tablesQuery.buttons["settingBtn"].tap();
It can't be found in table, I'm very counfuse about this question,
why the voice over and accessibility inspector can found the button, but element query can't?
I hope I can acquire some greate tips to fix this issue, thanks!