Connection to WDA timed out - after try to hide kayboard on iPhone

Hello to everyone :slight_smile:
Today I met a problem with hiding keyboard on iPhone 6S Plus(real device) using appium 1.6.5. After perform actions
(python):
el = driver.find_element_by_accessibility_id(“loginInput”) # pass
el.send_keys(login_data[“pass”]) # pass
driver.hide_keyboard() # fail

[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“accessibility id”,“loginInput”,“e9586e8e-706f-4273-87a1-218a16995474”]
[debug] [XCUITest] Executing command ‘findElement’
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8004/session/3B3B12DB-EC5B-427D-9BC3-C5A1AD6AA729/element] with body: {“using”:“accessibility id”,“value”:“loginInput”}
[debug] [JSONWP Proxy] Got response with status 200: {“value”:{“ELEMENT”:“2103C4C4-8BE6-4EC1-A6FF-23268B2A0BDE”,“type”:“XCUIElementTypeTextField”,“label”:“loginInput”},“sessionId”:“3B3B12DB-EC5B-427D-9BC3-C5A1AD6AA729”,“status”:0}
[debug] [MJSONWP] Responding to client with driver.findElement() result: {“ELEMENT”:“2103C4C4-8BE6-4EC1-A6FF-23268B2A0BDE”,“type”:“XCUIElementTypeTextField”,“label”:“loginInput”}
[HTTP] ← POST /wd/hub/session/e9586e8e-706f-4273-87a1-218a16995474/element 200 180 ms - 177
[HTTP] → POST /wd/hub/session/e9586e8e-706f-4273-87a1-218a16995474/element/2103C4C4-8BE6-4EC1-A6FF-23268B2A0BDE/value {“sessionId”:“e9586e8e-706f-4273-87a1-218a16995474”,“id”:“2103C4C4-8BE6-4EC1-A6FF-23268B2A0BDE”,“value”:[“p”,“a”,“s”,“s”]}
[debug] [MJSONWP] Calling AppiumDriver.setValue() with args: [[“p”,“a”,“s”,“s”],“2103C4C4-8BE6-4EC1-A6FF-23268B2A0BDE”,“e9586e8e-706f-4273-87a1-218a16995474”]
[debug] [XCUITest] Executing command ‘setValue’
[debug] [JSONWP Proxy] Proxying [POST /element/2103C4C4-8BE6-4EC1-A6FF-23268B2A0BDE/value] to [POST http://localhost:8004/session/3B3B12DB-EC5B-427D-9BC3-C5A1AD6AA729/element/2103C4C4-8BE6-4EC1-A6FF-23268B2A0BDE/value] with body: {“value”:[“p”,“a”,“s”,“s”]}
[debug] [JSONWP Proxy] Got response with status 200: {“status”:0,“id”:“2103C4C4-8BE6-4EC1-A6FF-23268B2A0BDE”,“value”:“”,“sessionId”:“3B3B12DB-EC5B-427D-9BC3-C5A1AD6AA729”}
[debug] [MJSONWP] Responding to client with driver.setValue() result: null
[HTTP] ← POST /wd/hub/session/e9586e8e-706f-4273-87a1-218a16995474/element/2103C4C4-8BE6-4EC1-A6FF-23268B2A0BDE/value 200 1405 ms - 76
[HTTP] → GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args:
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.6.5”,“revision”:null}}
[HTTP] ← GET /wd/hub/status 200 9 ms - 83
[HTTP] → POST /wd/hub/session/e9586e8e-706f-4273-87a1-218a16995474/appium/device/hide_keyboard {“sessionId”:“e9586e8e-706f-4273-87a1-218a16995474”,“strategy”:“tapOutside”}
[debug] [MJSONWP] Calling AppiumDriver.hideKeyboard() with args: [“tapOutside”,null,null,null,“e9586e8e-706f-4273-87a1-218a16995474”]
[debug] [XCUITest] Executing command ‘hideKeyboard’
[debug] [JSONWP Proxy] Proxying [POST /wda/keyboard/dismiss] to [POST http://localhost:8004/session/3B3B12DB-EC5B-427D-9BC3-C5A1AD6AA729/wda/keyboard/dismiss] with no body
[HTTP] → GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args:
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.6.5”,“revision”:null}}
[HTTP] ← GET /wd/hub/status 200 10 ms - 83
[debug] [XCUITest] Connection to WDA timed out
[debug] [iProxy] recv failed: Operation not permitted
[debug] [XCUITest] Cannot dismiss the keyboard using the native call. Trying to apply a workaround…
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8004/session/3B3B12DB-EC5B-427D-9BC3-C5A1AD6AA729/element] with body: {“using”:“class name”,“value”:“XCUIElementTypeKeyboard”}
[debug] [iProxy] Error connecting to device!
[debug] [XCUITest] No keyboard found. Unable to hide.
[debug] [MJSONWP] Responding to client with driver.hideKeyboard() result: null
[HTTP] ← POST /wd/hub/session/e9586e8e-706f-4273-87a1-218a16995474/appium/device/hide_keyboard 200 5358 ms - 76
[HTTP] → GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args:
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.6.5”,“revision”:null}}
[HTTP] ← GET /wd/hub/status 200 9 ms - 83

Please note that the same commands works fine on other devices (iPad Air, iPad Pro and on some android devices)

Thanks in advance for any kind of help.

Hi @mr.x, When I faced this issue with WDA, I added the below capability to my test suite

capabilitiesForAppium.setCapability(“maxTypingFrequency”,3000);

If there is no activity in 3000ms, WDA connection is getting timeout. You can increase the timeout frequency.

This may not be perfect solution but a workaround.

1 Like

Hello @SireeshaSimakurthy. Thank you for your reply. But this solution does not help in my case (I have tried with different values). I still have the same error.

Hi, did you get solution for this problem?

Hi , facing the same issue . Have anybody got the solution for it?