I am running some tests with Appium 1.3.2 on a game. I am trying to click on the bottom right corner on an element that I know the coordinates for and on many devices I run into the problem that Appium reports that the coordinates are invalid because they are outside the screen.
I checked the size that Appium reports using:
driver.manage().window().getSize()
and noticed that the reported window size is 886x540 on a device that really has a resolution of 960x540.
Also just trying to click on the bottom right corner produces the following in Appium logs:
[36minfo[39m: [debug] Pushing command to appium work queue ["element:touchDown",{"x":889,"y":473}]
[36minfo[39m: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:touchDown","params":{"x":889,"y":473}}
[36minfo[39m: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
[36minfo[39m: [debug] [BOOTSTRAP] [debug] Got command action: touchDown
[36minfo[39m: [debug] [BOOTSTRAP] [debug] Display bounds: [0,0][886,540]
[36minfo[39m: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"Coordinate [x=889.0, y=473.0] is outside of element rect: [0,0][886,540]","status":29}
[36minfo[39m: [debug] Responding to client with error: {"status":29,"value":{"message":"The coordinates provided to an interactions operation are invalid.","origValue":"Coordinate [x=889.0, y=473.0] is outside of element rect: [0,0][886,540]"},"sessionId":"8d43efa4-931a-4886-8940-4bd96fea3d07"}
The game I am testing is running in full screen mode, and if I take a screenshot and check it, the screenshot size is 960x540, with the game taking up the whole screen, no menu items and no buttons anywhere.
I have seen the same problem with other resolutions as well, where Appium simply reports that the size of the screen is smaller than it actually is.
Has anyone else run into this? Is there a workaround?