/appium-java-mobile-automation-demo

This project serves as a boilerplate for automating both Android and iOS mobile applications using a single codebase with TestNG and the Appium library.

Primary LanguageJavaMIT LicenseMIT

Mobile Application Automation Using Appium (For iOS & Android)

This project serves as a boilerplate for automating both Android and iOS mobile applications using a single codebase with TestNG and the Appium library.

Prerequisites

  1. Java
  2. Maven
  3. NodeJS

How to install the dependencies

  1. Install XCode

  2. Download and Install Android Studio

  3. Create a new system variable for ANDROID_HOME pointed to the Android SDK location

  4. Update the system path variable with ANDROID_HOME\platform-tools

  5. Install Appium 2.0

    npm i -g appium@next

  6. Install Appium Drivers

    appium driver install uiautomator2

    appium driver install xcuitest

Note: Environment Variables

image

How to run tests

  1. Using IntelliJ IDEA

    • Go to Maven Profiles
    • Select android or ios Maven Profile as the platform
    • Select dev, qa, uat, pre-prod or prod as the environment
    • Select the test classes on the src/test/java folder
    • Right-click and click on Run
  2. Using Command Line

    • To run Android tests in QA environment

      mvn clean test -Pandroid,qa

    • To run iOS tests in UAT environment

      mvn clean test -Pios,uat

Note: By default, if no Maven profiles are selected, the tests will be executed on the android platform and in the dev environment.

Tutorials

License

MIT License MIT License

Copyright

Copyright 2023 MaxSoft.