I am trying to find a way to tap a link with the following HTML structure:
Xcode UI Testing interacts with your app via accessibility. Just like it doesn't have access to the underlying UIKit elements, it doesn't have direct access to the HTML DOM. You cannot expect the framework to know about something in your markup unless that gets exposed to accessibility in some way.
To "see the app as UI Testing does" open Accessibility Inspector.app on your mac. (You can easily find this by searching for it in Spotlight.) Then, hover over the
div with your cursor. If you see any of the following attributes set you can query for the element:
If none of these are set on the
div elements you should update them yourself. Think of it this way. If someone who is visually impaired uses the site, how will he/she know that he/she can interact with the Facebook link?