Use the keyboard keys while automating Android apps
- 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 - Then use this code to access the keys where
AndroidKeyCode
is an enum with all of the possible key entries, for exampleKEYCODE_0
,KEYCODE_A
.Refer to this list of Android keys.AndroidDriver<?> driver = MobileDriverFactory.getDriver()
driver.pressKeyCode(AndroidKeyCode.ENTER)You can also refer to the video demonstration below: