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.
- Android Studio - Download and install Android Studio
- Set
ANDROID_HOME
environment variable:- Open Android Studio
- Open Settings (File -> Settings)
- In the search bar type
Android SDK
- Copy the Android SDK location path
- Set the path as
ANDROID_HOME
environment variable - Add
ANDROID_HOME
to PATH environment variable
- NodeJS - Download and install NodeJS
There are two ways to install Appium on your Windows machine.
- Installing Appium via command line:
- Open command line and run:
npm install -g appium
- Then run:
npm install wd
- Open command line and run:
- Installing Appium as desktop app:
- Download and install Appium destkop app (.exe file)
- Via command line:
- Open command line and run command:
appium -a 127.0.0.1 -p 4723
- Open command line and run command:
- Via the desktop app:
- Open Appium Server GUI desktop app
- Set host as
127.0.0.1
- Set port as
4723
- Click Start Server
- To use your Android device as a test device you have to enable developer options and USB debugging
- Run Android Studio
- Connect your device to the computer via USB
- You should see the
Allow USB debugging
dialog on your mobile phone. - Press
OK
button - If the dialog was not presented - open command line and run command:
adb devices
- While your Appium server is running and your Android device is connected open the
patronage22_mobile_auto_szczecin
project. - In the terminal run command:
mvn clean test -Ddevice="default"
- If the tests are not running and you are receiving some errors, you can use an additional tool Appium Doctor
- To install Appium Doctor in the command line run command:
npm install appium-doctor -g
- To find and fix possible issues in the command line run command:
appium-doctor --android
The Appium provides an additional tool to inspect a mobile app. To install the Appium Inspector download .exe file from project github page
- Run Appium Inspector while your Appium Server is running and the Android Device is connected to your computer,
- In the Appium Server tab set the Remote Host:
127.0.0.1
- In the Appium Server tab set the Remote Path:
/wd/hub
- In the Desired Capabilities tab you should define at least the platform name:
- Press
+
button in the Desired Capabilities tab - Add platformName text capability with value Android
- In the JSON representation on the right side you should see json:
{ "platformName": "Android" }
- Press
- Press
Start Session
button