Reputation: 469
The command perform_action('send_key_enter')
sends the enter key but for our search field, the enter key is replaced by the search key in the Android keyboard.
Is there a special perform_action
command to send the input of the search key?
Upvotes: 1
Views: 2950
Reputation: 469
I have been able to solve this by the following command: press_user_action_button('search')
Source: https://groups.google.com/d/msg/calabash-android/Tl14BqQeWoU/zlxm3hRIpsQJ as part of the v0.5.2
release notes.
Upvotes: 1
Reputation: 8446
What could be happening is your scripts aren't able to accurately locate ADB in order to send the command to the device. Try using the following, which uses default_device.adb_command - this should use the full path to ADB and also use the proper device id:
system("#{default_device.adb_command} shell input keyevent KEYCODE_ENTER")
Also, I can't take credit for this, so go ahead and take a look at this great post which helped me immensely when dealing with entering text:
Upvotes: 1
Reputation: 193
Try this : system("adb shell input keyevent KEYCODE_ENTER")
By 'adb shell input keyevent', either an event_code or a string will be sent to the device.
Please mention your error message if you still face same issue
Upvotes: 0