Can't click offscreen elements in 1.6.3 / IOS10.1

Since upgrading to 1.6, clicking an element that is not visible on the screen doesn’t work. From reading the logs it appears as though the command is being executed, but the action the click should trigger (opening a new page in this case) does not happen. In 1.5.3 clicking offscreen elements worked without issue. Is this behavior intended?

appium 1.6.3
ruby 2.3.0
OSX 11.5
iOS10.1 / iPhone7 simulator

log snippet:

command: find_element(:id, ‘Select a Different Location’).click

[HTTP] <-- POST /wd/hub/session/c07b3f2f-79a8-46b2-8000-7204d7bee5f1/element/4BFC777F-959A-452F-BC58-0346E8448EC3/click 200 856 ms - 118
[HTTP] --> POST /wd/hub/session/c07b3f2f-79a8-46b2-8000-7204d7bee5f1/element {“using”:“id”,“value”:“Select a Different Location”}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“Select a Different Location”,“c07b3f2f-79a8-46b2-8000-7204d7bee5f1”]
[debug] [XCUITest] Executing command ‘findElement’
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, accessibility id
[debug] [BaseDriver] Waiting up to 5000 ms for condition
[debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/EFEEE484-5FAD-49C3-A29E-797811465228/element] with body: {“using”:“id”,“value”:“Select a Different Location”}
[debug] [JSONWP Proxy] Got response with status 200: {“value”:{“ELEMENT”:“2D3F82E6-278A-4B04-BC91-984EC67574AA”,“type”:“XCUIElementTypeStaticText”,“label”:“Select a Different Location”},“sessionId”:“EFEEE484-5FAD-49C3-A29E-797811465228”,“status”:0}
[debug] [MJSONWP] Responding to client with driver.findElement() result: {“ELEMENT”:“2D3F82E6-278A-4B04-BC91-984EC67574AA”,“type”:“XCUIElementTypeStaticText”,“label”:“Select a Different Location”}
[HTTP] <-- POST /wd/hub/session/c07b3f2f-79a8-46b2-8000-7204d7bee5f1/element 200 341 ms - 195
[HTTP] --> POST /wd/hub/session/c07b3f2f-79a8-46b2-8000-7204d7bee5f1/element/2D3F82E6-278A-4B04-BC91-984EC67574AA/click {"{}":""}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command ‘proxyReqRes’
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/c07b3f2f-79a8-46b2-8000-7204d7bee5f1/element/2D3F82E6-278A-4B04-BC91-984EC67574AA/click] to [POST http://localhost:8100/session/EFEEE484-5FAD-49C3-A29E-797811465228/element/2D3F82E6-278A-4B04-BC91-984EC67574AA/click] with body: {"{}":""}
[debug] [JSONWP Proxy] Got response with status 200: {“status”:0,“id”:“2D3F82E6-278A-4B04-BC91-984EC67574AA”,“value”:"",“sessionId”:“EFEEE484-5FAD-49C3-A29E-797811465228”}
[JSONWP Proxy] Replacing sessionId EFEEE484-5FAD-49C3-A29E-797811465228 with c07b3f2f-79a8-46b2-8000-7204d7bee5f1
[HTTP] <-- POST /wd/hub/session/c07b3f2f-79a8-46b2-8000-7204d7bee5f1/element/2D3F82E6-278A-4B04-BC91-984EC67574AA/click 200 856 ms - 118

Hi @jheideman1,
After talking to some of our Appium developers they confirmed that, unfortunately, due to huge changes in the automation engine Apple provides, there will be some changes in automation behavior on iOS 10+ tests.

The Appium team is working hard to smooth out any of these differences that they can, but some may remain unresolved due to changes in Apple’s technology.

This action of “clicking offscreen elements with iOS” happens to be one of those methods that is now failing with the recent changes in automation behavior on iOS 10+ tests.

For more information on why we’re in this situation and a list of specific changes to be aware of, see the migration doc:

Thank you for your response. Is this issue considered a defect, or is the behavior impossible in the XCUI framework? The link you provided doesn’t make that clear.

I believe it fails because of the XCUITest driver update not apple XCTest API itself.
Our app is working fine with the 1.6.2 version to find and click offscreen elements.
But Android driver is failing on 1.6.2 version. So non of 1.6.3 or 1.6.2 are providing full functionality yet.
It is a bit frustrating if Appium cannot provide robust solution which we have to spend lots of time to find out which part of Appium framework is broken.
Hope these issue will be fixed in the future releases.

Hi @jheideman1 ,
Unfortunately, “clicking offscreen elements with iOS” is now one of the impossible actions due to the recent changes in automation behavior on iOS 10+ tests.

For instance, one of the main advantages of the recent changes in automation behavior on iOS 10+ tests is that users are now able to test their application in a more authentic way, as if an actual user was performing the actions on the simulator/device. As you can imagine, clicking an invisible element is not something that a human can do. Thus, I believe this could be a great rule of thumb to start discovering which methods will not longer be possible.

As a workaround, you will have to assure that the element is visible before performing the click.

Hi @wcyet8088,

Unfortunately, “clicking offscreen elements with iOS” is now one of the impossible actions with Appium 1.6.+.

To make sure that you get help with Android or any other iOS issues aside from the “clicking offscreen elements with iOS” issue, please consider submitting your request here:

is this issue resolved? I am also getting same problem when trying to click play video element which is offscreen