iOS geolocation testing automation - JAVA

I am writing automation to do tests and am running up against limitations for testing as well as limitations in appium feature sets.

One issue thus far is that I cannot check location before and after because the method for AppiumDriver.location() is returning an error code of ‘WebDriverException - Not yet implemented’. I am not sure as to when or if this will be implemented.

Other ways to check come to mind are image comparisons. One could set the location say to Philadelphia (AppiumDriver.setLocation(lat, long, alt)). Next wait a few seconds, then snap an image of the dot in the correct place, then use that as a basis. Image comparison however gets messy, especially having to take multiple images for different phone sizes or resolutions. The map could move or be in the wrong place also in two different loads. One can swipe and pinch but there’s no feedback to show exactly what scale or position on the map is in view.

Last idea is to get values directly from the MKMapView but WebElement doesn’t seem to support this complex of a level of detail in the interfaces it implements in the JAVA code. I do not see anything in the Apple documentation for a map object as well.

https://developer.apple.com/library/ios/documentation/developertools/reference/uiautomationref/_index.html

Any suggestions or clever ideas for validations and interactions or is this stuck with manual testing for now?

What’s the specific test case you’re interested in automating? That CurrentLocation is showing on some mapview?

As possible that when the device is told it is at a new set of geocoordinates, that the MKMapView updates accordingly. This will prove that the implementation (.m) file that is the delegate for iOS location change system calls is updating the MKMapView correctly. There are other things I need to test but being able to do this should make the rest easy. This is the base case.

If Apple supports it then you’ll be able to do everything via execute_script.

Hi Bjap, did you find a solution for this? I want to verify map location as well without image comparisons.