This documentation is deprecated. Please refer to appium-uiautomator2-driver repository
Edit this Doc How To Emulate IME Actions Generation
Very often Android developers use onEditorAction callback with actionId
argument to implement actions handling, for example, when Search
or Done
button is pressed on the on-screen keyboard. Appium since version 1.9.2 allows to automate the generation of such actions by providing the special mobile:
command.
mobile: performEditorAction
Executes the given editor action on the currently focused element.
Supported arguments
- action: The name or an integer code of the editor action to be executed. The following action names are supported:
normal, unspecified, none, go, search, send, next, done, previous
. Read https://developer.android.com/reference/android/view/inputmethod/EditorInfo for more details on this topic.
Usage examples
driver.executeScript("mobile: performEditorAction", ImmutableMap.of("action", "Go"));
driver.execute_script('mobile: performEditorAction', {'action': 'previous'})