Is there a better way to hide keyboard in Android device?

2,131 views
Skip to first unread message

Jerald vinoth kumar

unread,
Jul 26, 2014, 10:51:53 PM7/26/14
to appium-...@googlegroups.com

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

bootstrap online

unread,
Jul 26, 2014, 11:00:57 PM7/26/14
to Jerald vinoth kumar, appium-...@googlegroups.com
appium has a hide keyboard method that works on android. It'll only
close the keyboard if it's displayed.
> --
> http://appium.io
> ---
> You received this message because you are subscribed to the Google Groups
> "Appium-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to appium-discus...@googlegroups.com.
> Visit this group at http://groups.google.com/group/appium-discuss.
> For more options, visit https://groups.google.com/d/optout.

lampal...@gmail.com

unread,
Jul 27, 2014, 1:26:16 PM7/27/14
to appium-...@googlegroups.com, toje...@gmail.com

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.

bootstrap online

unread,
Jul 27, 2014, 5:17:50 PM7/27/14
to lampal...@gmail.com, Jerald vinoth kumar, appium-...@googlegroups.com

In the Ruby bindings I also wrap it in a try catch so that it doesn't fail if there's no keyboard.

ANKIT AGARWAL

unread,
Jul 28, 2014, 2:25:48 AM7/28/14
to appium-...@googlegroups.com
I am using appium java binding java-client-1.5.0.jar  and  android device 4.2 version 
an exception is generated  Not yet implemented. Please help us: http://appium.io/get-involved.html (WARNING: The server did not provide any stacktrace information)
Message has been deleted

Jerald vinoth kumar

unread,
Jul 29, 2014, 9:38:17 PM7/29/14
to appium-...@googlegroups.com, toje...@gmail.com
When I used the same command last month, it gave me some troubles and I stayed away from that. 
Now it seems to be working fine.
Thanks a lot for your suggestions!

-Jerald
Reply all
Reply to author
Forward
0 new messages