Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


UILabel found when searching by accessibility label only, not by value #201

ghost opened this Issue · 1 comment

1 participant


I have a UILabel contained within a UIView (within the top UIView within a UIViewController). If I wait for the UILabel based only on its accessibility label, the test passes. If I wait for the accessibility label and value, the test fails.

The problem is that the value being tested for doesn't match the value of the UILabel element. The problem is that this test is never executed on the element. For debugging, I added this log statement to line 87 of UIView-KIFAdditions.m:

NSLog(@"label: '%@' =? '%@', values: '%@' =? '%@'", element.accessibilityLabel, label, element.accessibilityValue, value);

When this step is run I see the element being tested in the line above:

[scenario addStep:[KIFTestStep stepToWaitForViewWithAccessibilityLabel:@"top label"]];

When this step is run I do not see the element being tested:

[scenario addStep:[KIFTestStep stepToWaitForViewWithAccessibilityLabel:@"top label" value:@"Online" traits:UIAccessibilityTraitStaticText]];

In storyboard, Accessibility is enabled and the "Static Text" trait is checked, as is "User Interaction Enabled".


So the problem is that the UILabel had userInteractionEnabled = YES, but the containing view did not. Should this be considered a bug or correct behavior? On one hand an element with userInteractionEnabled = NO is not "accessible", but on the other I'm calling stepToWaitForViewWithAccessibilityLabel: not stepToWaitForTappableViewWithAccessibilityLabel:


Closing all KIF 1 issues as it will no longer be maintained.

@phatmann phatmann closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.