Appium Tutorial - Step by Step Android Automation
Installation
- Download Java. (You can also download Java by using other ways.)
- Download Android Studio.
- Create Android Virtual Device.
- Download Appium Server GUI (latest version).
- Download Appium Inspector.
Set Environment Variable and System Path
- Add ANDROID_HOME variable and its path should be Android SDK’s path.
- Add JAVA_HOME variable and its path should be Java home path.
How to set JAVA_HOME for Windows 10?
How to set JAVA_HOME for Mac?
Here is the Example for MAC
export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-8.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin
export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/emulator
Launch the Desktop Application
- Launch Android Virtual Device (Android Emulator).
- Start Android Server GUI application.
- Start Appium Inspector application.
Explore Appium Basic for Android Automation
- Learn Desired Capabilities for Android.
- Ways to find app package and app activity name of your App.
adb shell dumpsys window | grep -E ‘mCurrentFocus’ - Appium Locator Strategies.
The most preferable locator strategy is UiSelector.
Example: How to use the text property.
new UiSelector().text(“Connected devices”)
Start Appium Inspectors
Here, we will work on Android In Built application of Settings.
Please add the basic capabilities as shown in the below screenshot then click on Start Session.
After Starting the Appium Server, you will see the similar view in Appium Inspector window.
Click on Search Icon then you will see the different locator strategy in dropdown.
Here, let’s select Android UiAutomator Selector.
Let’s Connect
Let me know — along with any questions, comments, or feedback that you might have on https://www.linkedin.com/in/nshthshah.