Key Event 'KEYCODE_SEARCH' doesn't work (do nothing)
See original GitHub issueDescription
Hello,
Key Event ‘KEYCODE_SEARCH’ doesn’t work (do nothing)
AndroidDriver dr;
dr.sendKeyEvent(AndroidKeyCode.KEYCODE_SEARCH);
I test it with a click on google search on android home, and after type toto
.
Environment
- java client build version or git revision if you use some shapshot: 5.0.4
- Appium server version or git revision if you use some shapshot: 1.8.1
- Desktop OS/version used to run Appium if necessary: Ubuntu
- Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:
- Mobile platform/version under test: Android 6
- Real device or emulator/simulator: Real device
Details
I test with a keypress with adb :
adb shell input keyevent KEYCODE_SEARCH
I have the same problem. So, perhaps it’s because of adb ?..
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Event.keyCode doesn't work with 'on input' - undefined
Try doing it with onkeydown and you will be able to access e.keyCode. so instead of: <input onkeypress="getKeyValue()"/>. You should do:
Read more >KeyboardEvent.keyCode - Web APIs - MDN Web Docs
[4] No key events are fired. [5] The key isn't available with Greek keyboard layout (does not input any character). The value of...
Read more >JavaScript Keycode List – Keypress Event Key Codes for ...
The keypress event works only for a subset of the keys. You can't capture the Alt, Ctrl, Shift, Meta, and other similar key...
Read more >Keyboard: keydown and keyup - The Modern JavaScript Tutorial
Please note that special keys, such as Backspace , Left , Right , do not work in the input. That's a side effect...
Read more >keydown and keyup events do not have proper keyCode (it's ...
Steps to reproduce: 1. Load the attached HTML file in Chrome for Android. 2. Click on the input element. 3.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This solution in JavaScript using wd worked for me:
return driver.waitForElementById(<elementId>).type(<text to type>).click().execute( "mobile: performEditorAction", { "action": "search" } );
This allowed me to find a text field, input some text, and submit a search command (same as clicking the search icon in the keyboard). Of course, you have to replace
<elementId>
and<text to type>
with the proper values. See http://appium.io/docs/en/commands/mobile-command/ for details on “mobile: performEditorAction”.@jarod-legault Awesome