Skip to content

Latest commit

 

History

History
70 lines (64 loc) · 3.38 KB

appium-configuration.md

File metadata and controls

70 lines (64 loc) · 3.38 KB

APPIUM CONFIGURATION


Prerequisites

To run the tests the Java Development Kit is required. If you don’t have the JDK configured, please install the JDK and set the JAVA_HOME and PATH environment variables.

Required tools

  1. Android Studio - Download and install Android Studio
  2. Set ANDROID_HOME environment variable:
    1. Open Android Studio
    2. Open Settings (File -> Settings)
    3. In the search bar type Android SDK
    4. Copy the Android SDK location path
    5. Set the path as ANDROID_HOME environment variable
    6. Add ANDROID_HOME to PATH environment variable
  3. NodeJS - Download and install NodeJS

Installing Appium

There are two ways to install Appium on your Windows machine.

  1. Installing Appium via command line:
    1. Open command line and run: npm install -g appium
    2. Then run: npm install wd
  2. Installing Appium as desktop app:
    1. Download and install Appium destkop app (.exe file)

Running Appium

  1. Via command line:
    1. Open command line and run command: appium -a 127.0.0.1 -p 4723
  2. Via the desktop app:
    1. Open Appium Server GUI desktop app
    2. Set host as 127.0.0.1
    3. Set port as 4723
    4. Click Start Server

Configure your Android device

  1. To use your Android device as a test device you have to enable developer options and USB debugging
  2. Run Android Studio
  3. Connect your device to the computer via USB
  4. You should see the Allow USB debugging dialog on your mobile phone.
  5. Press OK button
  6. If the dialog was not presented - open command line and run command: adb devices

Running Tests

  1. While your Appium server is running and your Android device is connected open the patronage22_mobile_auto_szczecin project.
  2. In the terminal run command: mvn clean test -Ddevice="default"

Troubleshooting

  1. If the tests are not running and you are receiving some errors, you can use an additional tool Appium Doctor
  2. To install Appium Doctor in the command line run command: npm install appium-doctor -g
  3. To find and fix possible issues in the command line run command: appium-doctor --android

Appium Inspector

The Appium provides an additional tool to inspect a mobile app. To install the Appium Inspector download .exe file from project github page

Appium Inspector configuration

  1. Run Appium Inspector while your Appium Server is running and the Android Device is connected to your computer,
  2. In the Appium Server tab set the Remote Host: 127.0.0.1
  3. In the Appium Server tab set the Remote Path: /wd/hub
  4. In the Desired Capabilities tab you should define at least the platform name:
    1. Press + button in the Desired Capabilities tab
    2. Add platformName text capability with value Android
    3. In the JSON representation on the right side you should see json: { "platformName": "Android" }
  5. Press Start Session button