[Mobile Web] Click is not working in Safari on real iOS device Appium 1.5.1/1.5.2

Hi,

I installed Apium 1.5.1 and discovered that “click()” doesn’t work
in Safari on a real device.

Here is an example what I’m trying to do:

findElement(By.id(“navToggle”)).click (See log output below)

This works perfectly fine on Android or in browser emulator, but not on real
iOS device.

I used to work on Appium 1.4.13, and I could do a workaround for iOS devices using tap(int
x, int y, double tapDuration, int touchCount, int tapCount). In version 1.5.1
tap is not working.

Any help would be much appreciated.

OUTPUT when click() fails:

[HTTP]

–> POST

/wd/hub/session/7bcb53fc-49ff-4e52-a68d-4102191796de/element

{“using”:“id”,“value”:“navToggle”}

[MJSONWP]

Calling AppiumDriver.findElement() with args:

[“id”,“navToggle”,“7bcb53fc-49ff-4e52-a68d-4102191796de”]

[debug] [iOS]

Executing iOS command ‘findElement’

[debug] [BaseDriver]

Waiting up to 0 ms for condition

[debug] [RemoteDebugger]

Executing ‘find_element’ atom in default context

[debug] [RemoteDebugger]

Sending javascript command (function(){return function…

[debug] [RemoteDebugger]

Sending WebKit data: {“method”:"Runtime.evaluate…

[debug] [RemoteDebugger]

Receiving WebKit data:

{“result”:{“result”:{“type”…

[debug] [RemoteDebugger]

Found handler for message ‘14’

[debug] [RemoteDebugger]

Received result for atom ‘find_element’ execution:

{“ELEMENT”:":wdc:1464848601444"}

[MJSONWP]

Responding to client with driver.findElement() result:

{“ELEMENT”:“5001”}

[HTTP]

<-- POST

/wd/hub/session/7bcb53fc-49ff-4e52-a68d-4102191796de/element 200

511 ms - 90

[HTTP]

–> POST

/wd/hub/session/7bcb53fc-49ff-4e52-a68d-4102191796de/element/5001/click

{“id”:“5001”}

[MJSONWP]

Calling AppiumDriver.click() with args:

[“5001”,“7bcb53fc-49ff-4e52-a68d-4102191796de”]

[debug] [iOS]

Executing iOS command ‘click’

[debug] [RemoteDebugger]

Executing ‘click’ atom in default context

[debug] [RemoteDebugger]

Sending javascript command (function(){return function…

[debug] [RemoteDebugger]

Sending WebKit data: {“method”:"Runtime.evaluate…

[debug] [RemoteDebugger]

Receiving WebKit data:

{“result”:{“result”:{“type”…

[debug] [RemoteDebugger]

Found handler for message ‘15’

[debug] [RemoteDebugger]

Received result for atom ‘click’ execution: null

[MJSONWP]

Responding to client with driver.click() result: null

[HTTP]

<-- POST

/wd/hub/session/7bcb53fc-49ff-4e52-a68d-4102191796de/element/5001/click 200

508 ms - 76

[HTTP] -->

POST /wd/hub/session/7bcb53fc-49ff-4e52-a68d-4102191796de/execute

{“script”:"return

document.readyState",“args”:[]}

I think I am running into the same issue with Appium 1.5.3 with iOS real devices. I am using the following code, and it doesn’t open the new tab. Clicking other elements works fine for me though, just not opening new tabs.