Closed dpgraham closed 3 years ago
I have the similar issue with hideKeyboard timeout after successful keyboard hide on java binding with appium v. 1.20.2 + iOS simulator of iPad 8th Gen iOS 14.4. Other devices work just fine, and does not time out
server logs
2021-03-19 18:20:42:564 [W3C (c214a631)] Calling AppiumDriver.hideKeyboard() with args: [null,null,null,null,"c214a631-348a-4247-89fc-4671aa154ac4"] 2021-03-19 18:20:42:564 [XCUITest] Executing command 'hideKeyboard' 2021-03-19 18:20:42:575 [WD Proxy] Proxying [POST /wda/keyboard/dismiss] to [POST http://127.0.0.1:10001/session/67955AC2-28BB-40E9-BADA-7E2F3C8DECE5/wda/keyboard/dismiss] with no body 2021-03-19 18:21:42:581 [WD Proxy] Error: timeout of 240000ms exceeded 2021-03-19 18:21:42:582 [WD Proxy] at createError (/usr/local/lib/node_modules/appium/node_modules/axios/lib/core/createError.js:16:15) 2021-03-19 18:21:42:582 [WD Proxy] at RedirectableRequest.handleRequestTimeout (/usr/local/lib/node_modules/appium/node_modules/axios/lib/adapters/http.js:280:16) 2021-03-19 18:21:42:582 [WD Proxy] at Object.onceWrapper (node:events:485:26) 2021-03-19 18:21:42:582 [WD Proxy] at RedirectableRequest.emit (node:events:378:20) 2021-03-19 18:21:42:582 [WD Proxy] at ClientRequest.eventHandlers.<computed> (/usr/local/lib/node_modules/appium/node_modules/follow-redirects/index.js:13:24) 2021-03-19 18:21:42:582 [WD Proxy] at ClientRequest.emit (node:events:378:20) 2021-03-19 18:21:42:582 [WD Proxy] at Socket.emitRequestTimeout (node:_http_client:780:9) 2021-03-19 18:21:42:582 [WD Proxy] at Object.onceWrapper (node:events:484:28) 2021-03-19 18:21:42:583 [WD Proxy] at Socket.emit (node:events:390:22) 2021-03-19 18:21:42:583 [WD Proxy] at Socket._onTimeout (node:net:480:8) 2021-03-19 18:21:42:583 [WD Proxy] at listOnTimeout (node:internal/timers:557:17) 2021-03-19 18:21:42:583 [WD Proxy] at processTimers (node:internal/timers:500:7) 2021-03-19 18:21:42:583 [XCUITest] Cannot dismiss the keyboard using the native call. Trying to apply a workaround...
You could try out the lest beta.
The keyboad thing depends on exists
attribute of https://developer.apple.com/documentation/xctest/xcuielementtypequeryprovider/1500511-keyboards?language=objc (app.keyboard.exists
), so if still it happened, only apple can fix it in probably the simulator side.
We're seeing this issue on any simulator when running with xcode 12.4, even on appium 1.22.0-beta.0
Update: Tried it with Appium v1.22.0-beta.0
on Xcode version 12.1
using a simulator iPhone XR / 13.7
and the issue is still happening:
2021-05-19 12:03:30:456 [XCUITest] Executing command 'hideKeyboard'
2021-05-19 12:03:30:464 [WD Proxy] Proxying [POST /wda/keyboard/dismiss] to [POST http://127.0.0.1:53856/session/86D13779-974E-47DE-A8E4-E7EC30980D6B/wda/keyboard/dismiss] with body: {"keyNames":["done"]}
2021-05-19 12:03:34:056 [WD Proxy] Got response with status 400: {"value":{"error":"invalid element state","message":"Error Domain=com.facebook.WebDriverAgent Code=1 \"Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test.\" UserInfo={NSLocalizedDescription=Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test.}","traceback":""},"sessionId":"86D13779-974E-47DE-A8E4-E7EC30980D6B"}
2021-05-19 12:03:34:056 [W3C] Matched W3C error code 'invalid element state' to InvalidElementStateError
2021-05-19 12:03:34:075 [W3C (36a8c417)] Encountered internal error running command: InvalidElementStateError: Error Domain=com.facebook.WebDriverAgent Code=1 "Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test." UserInfo={NSLocalizedDescription=Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test.}
2021-05-19 12:03:34:075 [W3C (36a8c417)] at errorFromW3CJsonCode (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:780:25)
2021-05-19 12:03:34:075 [W3C (36a8c417)] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:663:14)
2021-05-19 12:03:34:075 [W3C (36a8c417)] at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:272:19)
2021-05-19 12:03:34:075 [W3C (36a8c417)] at runMicrotasks (<anonymous>)
2021-05-19 12:03:34:075 [W3C (36a8c417)] at processTicksAndRejections (internal/process/task_queues.js:93:5)
2021-05-19 12:03:34:075 [W3C (36a8c417)] at XCUITestDriver.proxyCommand (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:96:12)
2021-05-19 12:03:34:075 [W3C (36a8c417)] at XCUITestDriver.hideKeyboard (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/general.js:175:3)
2021-05-19 12:03:34:076 [HTTP] <-- POST /wd/hub/session/36a8c417-4b4b-498c-85f1-5075339dbe30/appium/device/hide_keyboard 400 3619 ms - 1506
This used to work for us on xcode 12.1 and appium 1.19.1
Is it possible that something broke in 1.21.0
?
Improve performance of the keyboard dismissal logic appium-xcuitest-driver#1267, WebDriverAgent#458
Did the keyboard present on the view? Did the keyboard had 'done' key or another key?
The change was basically move keyboard existence check from xcuitest-driver to WDA native to improve performance. So, they should not be so different... Another possible case is the predicate search keyboard element failed to find it. Then, we potentially can turn around https://github.com/appium/WebDriverAgent/blob/master/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m#L275
The keyboard shows up and has the 'next' key.
We downgraded again to appium 1.19.1
on xcode 12.1 and hideKeyboard
is working again
Then, will http://appium.io/docs/en/commands/device/keys/hide-keyboard/ with keyName: 'next'
parameter work?
Thanks for the awesomely fast responses @KazuCocoa! I had to update some of our usages but I was able to get it working and unblocked our team for updating to the latest appium. 👍
@nicodn how did you get it working?
Using KazuCocoa's advice, self.driver.hide_keyboard(key_name='go')
worked for me. The target in my case was iOS 13.4 simulator, Xcode Version 12.5.1 (12E507) on MacMini M1 (Big Sur), appium v1.21.0.
`
<XCUIElementTypeKey type="XCUIElementTypeKey" name="@" label="@" enabled="true" visible="true" accessible="true" x="187" y="620" width="48" height="46" index="31"/>
<XCUIElementTypeKey type="XCUIElementTypeKey" name="." label="." enabled="true" visible="true" accessible="true" x="234" y="620" width="48" height="46" index="32"/>
<XCUIElementTypeButton type="XCUIElementTypeButton" name="Go" label="go" enabled="true" visible="true" accessible="true" x="281" y="620" width="94" height="46" index="33"/>
</XCUIElementTypeOther>
</XCUIElementTypeOther>
</XCUIElementTypeKeyboard>
`
The main thing for us was that now there's a big difference between how android and iOS hide the keyboard, so we had to update our tests to ensure that when we're calling driver.hideKeyboard(keyName)
on iOS, on Android we need to add an extra step to hit that keyName
separately, since Android doesn't tap the OK button when hiding the keyboard, it uses the back button.
Conversely, for some cases, we had to stop using hideKeyboard
on iOS tests when we didn't want to submit the input just yet.
i got error on java-client 6.1.0. im using kotlin
The problem
The release candidate is out and it has support for iOS 14.4
Environment
Code To Reproduce Issue [ Good To Have ]
Install Xcode 12.4 release candidate (12D4e) .
xcinfo
is a really good new tool for thisSelect Xcode 12.4
From
master
(b046f0edba2924794f98ed0b25aeaa6d0852cc64)Results: