Framework for Mobile test automation (Native app and Browser) on Android and IOS devices
Framework for Mobile test automation (Native app and Browser) on Android and IOS devices :iphone:
npm install -g appium
. Appium server version 1.22.1Command to check the installed appium version: `appium --version`
- ANDROID_HOME = <path to Sdk folder>
- %ANDROID_HOME%\tools
- %ANDROID_HOME%\tools\bin
- %ANDROID_HOME%\platform-tools
npm install -g appium-doctor
appium-doctor --help
To check Android set up `appium-doctor --android`
To check ios set up `appium-doctor --ios`
adb devices
adb devices
in cmd prompt to check whether the device is recognised<sdk emulator path>
Command to stard AVD: `emulator -avd <avd_name>`
Command to stop/kill AVD: `adb -e emu kill`
<path to sdk platform-tools>
adb install <apk filename>
If the app is already installed on your device then we can make use of appPackage and appActivity to launch the app
Option 1 :
adb shell dumpsys window | grep -E 'mCurrentFocus|mFocusedApp'
NOTE: This command may not work for newer Android OS (10 or 11). In that case, use command:
adb shell "dumpsys activity activities | grep mResumedActivity"
Option 2 : Install APK info app to retrieve appPackage and appActivity for the app installed in your device
<path to sdk folder>\tools\bin\
uiautomatorviewer
Type url `chrome://inspect/#devices` in the desktop chrome browser and start inspecting element
Add below lines in the Desired capabilities
capability.setCapability(AndroidMobileCapabilityType.AVD, "Pixel_3a");
capability.setCapability(AndroidMobileCapabilityType.AVD_LAUNCH_TIMEOUT, "180000");
Start appium server using command appium --allow-insecure chromedriver_autodownload
Add below line in the AppiumServiceBuilder
AppiumServiceBuilder builder = new AppiumServiceBuilder();
builder.withArgument(GeneralServerFlag.ALLOW_INSECURE, "chromedriver_autodownload");
Use AppiumServiceBuilder
and AppiumDriverLocalService
to start the server programmatically Set environment
variable APPIUM_HOME = <path to npm folder>\node_modules\appium\build\lib
where main.js
file is present
:point_right: Supports Android and iOS Real Devices and Emulators.
:point_right: Ability to start and stop the appium server on run-time. Configurable through config.properties
:point_right: Supports capturing appium server logs on run-time.
:point_right: Page object model design.
:point_right: Supports parallel and sequential execution of tests.
:point_right: Ability to capture screen(video) recording of tests on Android and iOS. Configurable
through config.properties
:point_right: Supports capturing screenshots for passed/failed/skipped steps which is configurable
through config.properties
:point_right: Ability to retry failed tests which is configurable through config.properties
:point_right: Customised exception handling to provide the exceptions in a meaningful way.
:point_right: Custom framework annotation to provide author name and category for each test.
:point_right: Supports utilities to read test data from excel workbook and provides data to each test based on the test name.
:point_right: Run test using command mvn test -Dsurefire.suiteXmlFiles=<provide the testng xml to execute>
:point_right: Create or Select the required testng xml -> Right click and select Run