xctest iOS UI test - tapping link not working

13 views Asked by At

My application looks very much like this:

How to tap on specific part/Words of a string statement in XCode UI Tests without using coordinate method

Where I have a sentence like below:

"Here's a sentence with a link users can click on"

The "link" above opens another page.

My goal of the test is to test the behaviour when users tap on this link.

When I do print(XCUIApplication().debugDescription)

TextView, 0x1xxxe120, {{22.0, 636.7}, {323.5, 73.1}}, label: 'Here's a sentence with a link users can click on'

Link, 0x103xxxe7e0, {{25.0, 702.2}, {314.5, 51.6}}, label: 'link'

However below code doesn't open the page.

let textLink = app.links["link"]
textLink.tap()

Any advise would be appreaciated.

0

There are 0 answers