Can we hide android soft keyboard?

Hi Ravi,

Tried running the script multiple times but no success. Even checked the keyboard settings but not found “Appium Android Input Manager” in the keyboard list.

After trying mentioned ways on web. I just thought to try other way, even though it is not correct but I had spent more time with this issue I tried following shortcut method:

After getting soft keyboard I just refreshed the page.
webdriver.navigate().refresh();

Please let me know if you have any suggestion.

Thanks Ravi.

Thanks Telmo,
It’s really helpful to handle the unstable functionality of poping up of device keyboard.

Thanks Telmo, it worked !!

1 Like

Why not simple select an other element and click() on it to hide the keyboard? Like this:
await driver.waitForElementByAccessibilityId(‘donglePin’, 20000).elementByAccessibilityId(‘donglePin’).setText(donglePin);
await driver.waitForElementByAccessibilityId(‘donglePinEntryIcon’, 20000).elementByAccessibilityId(‘donglePinEntryIcon’).click(); //keyboard is hidden now

IT WORKED WITH ANDROID STUDIO EMULATOR

Tnx for your answer
for python:
desired_caps[‘unicodeKeyboard’] = True
desired_caps[‘resetKeyboard’] = True

this works for me. Thanks

By using the following command we can hide the keyboard:
((DeviceActionShortcuts) dr).hideKeyboard();
or
driver.hideKeyboard();
Ref: https://appium.readthedocs.io/en/stable/en/commands/device/keys/hide-keyboard/

2 Likes

Hi @willosser

I’m having the same issue where I would like to hide the native keyboard within my app testing.
Where exactly would I put tis line of code please?
appium_driver.hide_keyboard
Thanks
Zaif

Thank you so much it worked like a charm I am adding it to all my future tests also adding it to my singleton driver for the framework. :coffee: