iOS UI Automation element finds no sub-elements

前端 未结 2 1576
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 14:11

I\'m just starting out with UI Automation for my iOS app and am already having trouble. I\'m unable to attach screen shots so I\'ll do my best to describe my scenario.

2条回答
  •  故里飘歌
    2021-02-06 14:43

    When you set accessibilityLabel for an element and flag it isAccessibilityElement = YES; the subviews of that element are hidden. For automation, you should use accessibilityIdentifier instead of accessibilityLabel and set isAccessibilityElement = NO;

    In your objective C code after physicianCollectionView is rendered, remove the label and accessibility flag and do this instead:

    physicianCollectionView.accessibilityIdentifier = @"PhysicianCollectionParentView";
    physicianCollectionView.isAccessibilityElement = NO;
    

    For last elements in element tree, which do not have sub views, set isAccessibilityElement = YES;

提交回复
热议问题