[Solved] Android OS 11 - Unable to perform keyboard action using executeScript

Unable to perform the keyboard actions by using the executeScript option. Below is the sample code

driver.executeScript(“mobile: performEditorAction”, ImmutableMap.of(“action”, “search”));

The same code is working fine on Android 10 or below OS versions.

Hello,

I have the same problem with this command:
driver.execute(‘mobile: performEditorAction’, { ‘action’: ‘Done’ });
It’s working on Android OS 9 and 10 but not on Android 11

Is it an appium bug? Do you have some information about this issue please?
Thank you :slight_smile:

You can use the below alternative approach to use the keyboard options.

((AndroidDriver) driver).pressKey(new KeyEvent(AndroidKey.ENTER)
.withFlag(KeyEventFlag.SOFT_KEYBOARD)
withFlag(KeyEventFlag.KEEP_TOUCH_MODE)
withFlag(KeyEventFlag.EDITOR_ACTION));

This is working good. Hope this helps!

1 Like

Thank you for your answer, I’ll try this :slight_smile:

It’s works to me! I’m using android 13.