appium/java-client

unicodeKeyboard and resetKeyboard capbilities removed from java-client 9.0.0

LissaRider opened this issue · 2 comments

Description

Hello. How now to hide keybord in Android (UIAutomator2 and Espresso) generally?

Environment

  • Java client build version: 9.0.0
  • Appium server version: 2.2.1
  • Uiautomator2 driver version: 2.32.3
  • Espresso driver version: 2.26.10
  • Node.js version: 18.18.0
  • Mobile platform/version under test: Android/any version
  • Emulator: any

Details

The keyboard makes it difficult to check:

  • the page as a whole (for example, that certain elements are displayed when the page loads, but at the same time we have an input field on the page and the cursor is automatically placed in this input field and and the keyboard that appears hides the items you need to search);
  • individual elements on the page (for example, if we have several input fields , then when you enter into the first field, the keyboard will hide the second input field).

It's terrible to use the method of hiding the keyboard every time it is shown.
At the very least, time is lost hiding the keyboard and debugging tests.

Alternative

To solve this problem temporarily I have to use "adb" commands:

  • Get the current active keyboard: adb shell "ime list -s"
  • Disable permanently the current keyboard: adb shell "ime disable {IME_KEYBOARD_VALUE}"
  • Later on, restore the keyboard: adb shell "ime reset"

You may use the recently added appium:hideKeyboard capability

In case of an older driver version it is still possible to provide the appium:unicodeKeyboard one as a string. There is just no dedicated constant for it as it will be anyway removed in the future.