Searching for a UILabel with Text

22 views
Skip to first unread message

Aviad Sachs

unread,
Feb 27, 2017, 11:47:47 AM2/27/17
to KIF iOS Automated Testing Framework
Hi all!

Is there a good practice to find text on screen?

I test a flow where at its end there should be a cell in table which is a custom view - nested inside is a UILabel with text. It's very visible to user.
But I can't find the API to validate it's there!

For some reason the AccessibilityLabel of that label is not the text. its empty :(

Any Idea? 

mike...@aol.com

unread,
Feb 27, 2017, 12:51:16 PM2/27/17
to kif-fr...@googlegroups.com
You can have the accessibilityLabel set to anything you want if you've got access to the code.
For example, cell.accessibilityLabel = <label's text> could do it (you could put the accessibility on the cell itself).

then [tester waitForViewWithAccessibilityLabel:<the label>] would work. 

Rhetorically, What do you see in the accessibility inspector? 


--
You received this message because you are subscribed to the Google Groups "KIF iOS Automated Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kif-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages