Navigate back or home screen using Appium
Class AndroidDriver (implements AppiumDriver interface) has method pressKeyCode(int key) for your handset / emulator to navigate to Home screen or navigating back. the argument key can be any one of the option from below linkhttps://developer.android.com/reference/android/view/KeyEvent.html To navigate to home screen: driver.pressKeyCode(AndroidKeyCode.HOME); Navigate to back screen: driver.pressKeyCode(AndroidKeyCode.BACK); Let’s see how we can implement in code those above…