Android native keyboard automation using appium

3,022 views
Skip to first unread message

Satishbabu Sadula

unread,
Apr 9, 2014, 2:08:04 AM4/9/14
to appium-...@googlegroups.com
i have an app with some text fields i am entring values using send keys method when i run on simulator its working iam not getting any keyboard pop up but when iam running on real device iam getting a keyboard with next key how i automate the next button click on keyboard

Jonathan Lipps

unread,
Apr 9, 2014, 7:21:14 PM4/9/14
to Satishbabu Sadula, appium-...@googlegroups.com
find and click the button itself.

On Apr 8, 2014, at 11:08 PM, Satishbabu Sadula <satish...@geniusport.com> wrote:

i have an app with some text fields i am entring values using send keys method when i run on simulator its working iam not getting any keyboard pop up but when iam running on real device iam getting a keyboard with next key how i automate the next button click on keyboard

--
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.

Naveen Kumar

unread,
Jun 12, 2014, 7:13:54 AM6/12/14
to appium-...@googlegroups.com, satish...@geniusport.com
How to find/click button on keyboard?
I have a search textbox in android's hybrid app 'olx' with no button to submit the text for search (only hit magnifier key in keyboard),  I can enter text using sendkeys(). However, element.submit() or element.sendkeys(Keys.Enter) functions are not working for me to search. Please suggest.

Isaac Murchie

unread,
Jun 13, 2014, 7:06:20 PM6/13/14
to Naveen Kumar, appium-...@googlegroups.com, satish...@geniusport.com
You will probably need to figure out path to the element that is the magnifier. Inspector might be of use for that.

appium.te...@gmail.com

unread,
Jul 9, 2014, 4:06:25 AM7/9/14
to appium-...@googlegroups.com, satish...@geniusport.com
Hello!
Any update on this issue please?
I have the same problem, a search box on android app and no Search button in the application to submit the text for search. Is there a way to press with appium the Search Key on Android keyboard (Ruby)?
These are NOT workig:  #$driver.key_event(84) or  $driver.execute_script("mobile: key_event", 84)
Best regards!

Naveen Kumar

unread,
Jul 9, 2014, 4:15:56 AM7/9/14
to appium-...@googlegroups.com, satish...@geniusport.com
Hi,

Below code(in C#) worked for me, I hope you can take a reference: 

System.Diagnostics.Process process = new System.Diagnostics.Process();
                System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
                startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                startInfo.FileName = "cmd.exe";
                startInfo.Arguments = "/C adb shell input keyevent 66";
                process.StartInfo = startInfo;
                process.Start();

//For key reference, you can go here:

appium.te...@gmail.com

unread,
Jul 9, 2014, 6:20:30 AM7/9/14
to appium-...@googlegroups.com, satish...@geniusport.com
Thanks a lot for the idea!

I tried this in Ruby but still NOT working  these commands to press Search on Android onboard keyboard, if anyone tried this in Ruby and succeeded please help :)

#system("adb shell input keyevent KEYCODE_84")
#system("adb shell input keyevent 66")

system('adb shell input keyevent KEYCODE_SEARCH')
system('adb shell input keyevent KEYCODE_ENTER')

Best regards!
Reply all
Reply to author
Forward
0 new messages