Search code examples
appiumappium-iosappium-android

How to press (or send key) Enter or Backspace in Appium


In Android, you can send key code which Android has supported for Android already (for references)

But in iOS, no document describes that how to press Enter and Backspace in iOS (XCTest).

I accidentally figure out how to do that, so I made this ticket to help you guys.


Solution

  • So you can send below specified letter:

    sendKeys('\n') for press Enter

    and

    sendKeys('\b') for press Backspace

    Update: Test on Appium version 7.1, it does not work on Android. Use this way to type Enter, Next, Go key.

    https://appium.readthedocs.io/en/latest/en/writing-running-appium/android/android-ime/

    Reference more sendKeys API in other programming languages