I’m using Appium to automate an Android App. After entering values to the edit fields, I’m calling driver.navigate.back() to close the soft keyboard. Is there a better way to do that?
Is there a way to find whether keyboard is present or not? I would like to call the above function only when the Keyboard is displayed.
Thanks,
Jerald
There is no way in Appium to find if keyboard is displayed or not. hidekeyboard works fine if keyboard is displayed , otherwise it fails and someties it stops appiumdriver.
We have applied following tweaks to overcome this :
1. Make it force appear by tapping on edittext box before entering text and then used hidekeyboard.
2. Use try catch, so it does not stop driver/fail test script, if keyboard is not displayed.
In the Ruby bindings I also wrap it in a try catch so that it doesn't fail if there's no keyboard.