How to use Appium Framework

What is Appium Framework?

Appium is an open-source automation mobile testing tool, which is used to test the application. It is developed and supported by Sauce Labs to automate native and hybrid mobile apps. It is a cross-platform mobile automation tool, which means that it allows the same test to be run on multiple platforms. Multiple devices can be easily tested by Appium in parallel.Appium is used for automated testing of native, hybrid, and web applications. It supports automation test on the simulators (iOS) and emulators (Android) as well as physical devices (Android and iOS both). Previously, this tool mainly focused on IOS and Android applications that were limited to mobile application testing only. Few updates back, Appium declared that it would now support desktop application testing for windows as well. On Android, Appium proxies the command to a UIAutomator script running on the device. UIAutomator is a native UI automation framework of Android that allows you to run Junit test cases directly into the device using command line. Although it uses Java programming language, but Appium allows to run it from any WebDriver supported language.

Advantages of Appium

  • Appium is a cross-platform, freely available mobile testing tool, which allows us the cross-platform mobile testing. This means you can test on multiple platforms (single API for both Android and IOS platforms).
  • It allows the automated testing of hybrid, native, and web applications.

Features of Appium

  • Appium has multi-platform support i.e., it can run the same test cases on multiple platforms.
  • Appium allows the parallel execution of test scripts.
  • Appium supports various languages like C#, Python, Java, Ruby, PHP, JavaScript with node.js, and many others that have Selenium client library.

Prerequisites before running the script for Appium setup

  • Set JAVA_HOME as an environment variable SDK and go to Local-Android-sdk and set below variables into PATH environment variables
  • Set ANDROID_HOME as an environment variable - pointing to the directory where Android SDK should be setup
  • Set Platform_Tool as an environment variable
  • Set Build_Tool as an environment variable
  • Set Tool as an environment variable

How to Install And SetUp The Appium Framework

  1. Download and Install Appium-Server-GUI(appium-desktop) https://github.com/appium/appium-desktop Start Appium server on default port
  2. Download and Install Android Studio https://developer.android.com/studio Create New Device and Launch Android Emulator in Android Studio
  3. Download and Install appium-inspector-main https://github.com/appium/appium-inspector
  4. Download SDK Tools https://developer.android.com/studio
  5. Download uiautomator2 appium driver install uiautomator2

How to run Appium Test on Local machine

  1. Clone the repo git clone https://github.com/applied-ai-consulting/aiTest-Appium-Framework.git
  2. Open cloned repo folder in Eclipse.
  3. Create New Device and Launch Android Emulator in Android Studio Create New Device
  4. Connect Android device to Computer System through USB cable or you can use virtual device
  5. In Android Studio go to system setting and click on Android SDK then download and install SDK Platforms and SDK Tools Packages. Android SDK
  6. Check device connection with your local machine using below command from command line adb devices adb devices
  7. Start appium server manually ( update the url/port if not using the default) Appium Server
  8. Have devices connected / emulators started. Accordingly, update the (.*Test.java) test file with the relevant information about the devices
  9. Add code to start automation on mobile device set desired capabilities in appium inspector ` deviceName ` ` udid ` ` platformName ` ` platformVersion ` ` https://127.0.0.1:4723/wd/hub ` Appium Inspector
  10. To run Project folder use mvn clean install -target=local -DdeviceName=<emulator_name> -DdeviceVersion=<emulator_version> from command line.
  11. also To run Project folder use mvn install command from eclipse

Questions Answered

  • How to Install And SetUp The Appium Framework?
  • How to run Appium Test on Local machine?
  • What is Appium Framework?
×

Subscribe

The latest tutorials sent straight to your inbox.