Appium

Posted on  by 

  • Mobile Testing Tutorial
  • Mobile Testing Useful Resources
  • Selected Reading

Appium Java Client

Appium is an open-source test automation framework for testing native and hybrid apps and mobile web apps. It drives iOS and Android apps using the WebDriver protocol. Architecture of the Appium Framework. Appium is an HTTP server that is written on the Node.js platform whose set up comprises a REST (Representational State Transfer) API and implements Selenium WebDriver. It works on a client/server architecture. Appium allows the uses of the available WebDriver client for firing the tests. Appium is an open source test automation framework used for mobile automation testing across different platforms such as iOS and Android. It also supports mobile web browser automation and has a. Appium is an automation testing tool that can be used to validate mobile browsers and mobile applications. This tool is widely used in mobile automation testing because it is free and can support both iOS and Android platforms. Appium has slight differences in terms of execution when it comes to Android and iOS. Let’s have a look. Appium on Android. Appium on Android uses the UIAutomator framework for automation. UIAutomator is a framework built by android for automation purposes. So, let’s take a look at the exact way that Appium works on Android.

Appium is an open-source test automation framework for testing native and hybrid apps and mobile web apps. It drives iOS and Android apps using the WebDriver protocol.

Advantages of Appium

  • It’s free and (mostly) open source.

  • It has a very well supported and active Google group.

  • It’s in the Selenium 3 spec so should be future proof.

  • It supports both Android and iOS.

  • It does not require anything to be installed on the device – no server or code changes required.

Drawbacks of Appium

  • No support for intelligent waits.
  • On iOS, you can only execute one test at a time per Mac.
  • Limited support for gestures.
  • Limited support for Android < 4.1

How to Use Appium

Step 1 − The prerequisites to use Appium is Java SDK (minimum 1.6). If you don’t have Java installed on your system, then follow the steps given below.

Appium mobile testing
  • Download JDK and JRE from Oracle JavaSE

  • Accept license agreement.

  • Install JDK and JRE.

  • Set environment variable as shown in the screenshot below.

Step 2 − Download Android Studio from SDK (It will take time because of the size of the file).

  • Double click the exe and run the installer.
  • Continue with all default options.
  • Set the ANDROID_HOME.
Appium desktop

Step 3 − Install Android images and tools.

  • Click on SDK Manager −
  • Select the necessary package. For example, if we are building an App for Android 4.4.2, then make sure the following packages are checked under the Tools section −

    • Android SDK Tools rev 22.6.3
    • Android Platform-tools rev 19.0.1
    • Android SDK Build-tools rev 19.1

Step 4 − Create Android Virtual Devices −

  • Open Android Studio and click AVD Manager in the toolbar. AVDs allow us to test and run our Android apps.

  • Use the following settings for a Nexus5 AVD −

    • Device: Nexus 5 (4.95, 1080 x 1920; xxhdpi)

    • Target: Google APIs x86 (Google Inc.) - API Level 19

    • Make sure you select the target with Google APIs in the name.

    • CPU: Intel Atom (x86)

    • Check the box for Use Host GPU

    • Click OK.

  • You should now see the AVD you created in the AVD Manager, where you can start it, delete it, or create another one!

Step 5 − Download Appium jar files from Appium

Test an App with Appium

To test an App with Appium, follow the steps given below −

Step 1 − Create a test Project in the Android Studio named as “RobotiumTest”.

Choose all the default options until you reach to the main page.

Step 2 − Add the Appium jars into your project. Click Project → App → copy all the jars in lib. Select the copied jars except Selenium, Java client and Junit Jar, then right-click on it and click on 'Add as Library'.

Step 3 − Click on build.gradle in the App. You will see all the libraries added, as shown in the following screenshot.

Step 4 − Now create a Java class as shown below −

Step 5 − Running the Test case.

  • Click on build variant and select Unit Testing.
  • Start the Appium server with the specific port '4444'.
    • Download the Appium for Windows from here.
    • Double click on the .exe and install Appium.
    • Click on the icon to up the UI.
    • Change the port if required, as shown below.
    • Click the Play button to start the server.
  • Connect the device with USB debugging on or start an emulator.
  • Right-click the test class and click on 'Run'.

Appium Architecture


Coments are closed