Skip to main content

Use the keyboard keys while automating Android apps

  1. Import the following library on the top of your test script.
    import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory

    import io.appium.java_client.android.AndroidDriver
    import io.appium.java_client.android.AndroidKeyCode
  2. Then use this code to access the keys where AndroidKeyCode is an enum with all of the possible key entries, for example KEYCODE_0, KEYCODE_A.
    AndroidDriver<?> driver = MobileDriverFactory.getDriver()
    driver.pressKeyCode(AndroidKeyCode.ENTER)
    Refer to this list of Android keys.

    You can also refer to the video demonstration below: