Install android apps on emulators

Method 1: Using Google play store (but you need to have google account and google play store should be pre installed) Most of the android real devices (mobiles or tablets), we can install .apk files (android apps) from Google Play store, this can be possible only if .apk files are published for public use. But if .apk…

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…

Lock or unlock device using appium

Class AndroidDriver (implements AppiumDriver interface)  has certain methods for locking and unlocking an android device / emulator at run time. (should upgrade java-client.jar to version 4) Methods: isLocked() – Check if device is locked Returns true, if device is locked, else returns false Unlock a device Lock a device NOTE: these methods doesn’t hold good if…