iOS Coordinate System

I noticed an interesting issue on iOS 10 (Appium 1.6.0, XCUITest).

Suppose you simply want to tap the point (x, y) using absolute screen coordinates. For the sake of simplicity let’s assume the current orientation is lanscape.

On Android and iOS 9 devices the coordinates are always what you expect: (0, 0) is the top-left corner, x-axis points to the right, y-axis points downwards.

However, on iOS 10 the things are more tricky. if driver.orientation is ‘[bla-bla]_LANDSCAPERIGHT’, the point (0, 0) is in the top RIGHT corner, x-axis points downwards, and y-axis points to the left. If driver.orientation is ‘LANDSCAPE’, the point (0, 0) is in the BOTTOM left corner, x-axis points upwards, and y-axis points to the right.

Is this behavior by design? Things get rather complicated.

I think It’s not that landscape coordinates origin change position, but that XCUITest just is set to the portrait orientation coordinate system. That is a huge issue for me too, and it would be awesome if someone would pick up this topic.

Please anyone let me know If tapping through coordinates working in Appium v1.6.1? Or TouchAction functions are missing in this version??

It is possible, you just have to give it coordinates relative to the origin in portrait mode, so when holding the device in portrait mode the upper left corner of the screen is 0,0, downwards is y, and to the right it’s x. That can be especially troubling when dealing with landscape apps, because in appium as far as i know, you cannot tell a difference between landscape right and left state.