I want to access callout views and do some UIAutomation on those views. I'm able to click on map markers/annotations but not able to access the callout view.
The following code used to tap on the marker:
let marker = app.otherElements.matching(identifier: "mapMarker").element(boundby: 0)
marker.tap();
After this, I'm getting the callout view of the respected marker/annotation. I need to access that callout. Please suggest me on this.
You should create a breakpoint after the callout is snown, then type
po print(app.debugDescription)(or simplypo appin XCode 11) inlldbin order to view the whole hierarchy of UI elements.Locate the needed element and access it further in code.
Also, consider rewriting your marker code in a shorter way:
let marker = app.otherElements["mapMarker"].firstMatchPlease notice
firstMatchaborts search of elements after it found the first one.Drop
firstMatch, if you want to check that the element is uniquelet marker = app.otherElements["mapMarker"]