You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[iOS] WDA cannot dismiss keyboard – hideKeyboard not supported #1058
When attempting to dismiss the iOS keyboard using Appium + WebDriverAgent, the keyboard is not dismissed and WDA throws an error. This blocks automation flows where text entry is followed by other UI interactions.
-------Error 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.}
-----Steps to Reproduce-----
1.Launch iOS app using Appium + WDA.
2.Locate a text field and call element.sendKeys("test").
3.Attempt to dismiss the keyboard via driver.hideKeyboard().
4.Observe that WDA throws the above error and the keyboard remains visible.
-----Expected Behavior------
Keyboard should be dismissed when calling hideKeyboard(), or
WDA should provide a supported mechanism to dismiss the keyboard consistently across iOS versions.
-----Actual Behavior------
Keyboard remains visible.
WDA responds with an error message and does not handle dismissal.
This behaviour is expected. If the keyboard itself does not provide an explicit key to hide it then the only way to dismiss it would be to use the same gesture that an app user would use. XCTest itself does not provide any magic APIs to achieve that.
Activity
mykola-mokhnach commentedon Sep 9, 2025
This behaviour is expected. If the keyboard itself does not provide an explicit key to hide it then the only way to dismiss it would be to use the same gesture that an app user would use. XCTest itself does not provide any magic APIs to achieve that.
nanoscopic commentedon Apr 10, 2026
Has anyone tried "[[UIKeyboardImpl sharedInstance] dismissKeyboard];" in WDA?
I seem to recall having seen a private API call besides that to hide it as well. I'm quite sure "does not provide any magic APIs" is actually false.
Also, connecting a usb or bluetooth keyboard will cause the OSK to be hidden.