Reputation: 2164
My app under test has an element (a UIAStaticText
) which has accessibility enabled (with the accessibility-label "Progress").
Accessing this element using Swift is easy and well-documented. But my app's source is in Objective C.
How do I access this element using Xcode UI Testing and Objective C?
Upvotes: 1
Views: 2768
Reputation: 2164
I found one way to do this. This does get me the correct element - but I feel there has to be a simpler answer that does not rely on me knowing the element's type (staticText).
If anyone has a better answer, you are welcome to contribute.
XCUIElement *progressTextByAccessibility = [[app staticTexts] elementMatchingType:XCUIElementTypeStaticText identifier:@"Progress"];
Upvotes: 1