Appium Tutorial for Mobile Automation- The Comprehensive guide-20-21

Appium Tutorial
Appium Tutorial

We have written this Appium tutorial to give  a complete picture of Appium mobile automation. We will discuss all the major topics here.

Introduction

It is an open-source tool. It supports  Android, iOS, windows OS. We can execute same code in different os versions like Android, iOS.It reduces redundant code and helps to increase code reusability. It has implemented the Selenium webDriver, which connects through Apple’s XCUITest(iOS 9.3 and above) or UIAutomation(iOS 9.3 and lower) or UiAutomator/UiAutomator2 (Android) or WinAppDriver(Windows) dependent on the type of devices.

We will cover the below topics in this Appium tutorial:

Advantages of Appium

  • It is an open-source tool. Anybody can install it and start automating.
  • We can automate native, hybrid, mobile web applications.
  • We can execute the same code in different cross platform like Android, iOS.
  • Users do not need any third party agent.

Disadvantages of Appium

  • Reports are not in detail.
  • Parallel execution is not supported in iOS below iOS 9.3.
  • Due to remote WebDriver, performance is slow.

Types of Mobile applications

There are three types of applications supported :

Native Application

Native applications are written using Windows, Android, iOS SDKs.

Hybrid Application

Hybrid applications are a mix of web and native applications. Here native applications have control, and it interacts with mobile web applications.

Mobile Application

Mobile web applications are web-based applications. These are accessible using chrome(Android), Safari(iOS) browser. We can develop this type of application by HTML, CSS, JavaScript, AngularJS.

Appium Architecture :

  • It is an HTTP server, written in a Node.js platform. Different driver sessions like Android, iOS connect to the server through WebDriver JSON wire protocol
  • When It gets installed through a command prompt or GUI, a server receives set up to expose a REST API
  • We start the server through the command prompt or GUI and run our tests through different clients like java, python, javascript, etc. The server receives the client’s connections call and commands and executes them (Android, iOS).
  • It uses Apple’s XCUITest(iOS 9.3 and above) or UIAutomation(iOS 9.3 and lower) to interact with iOS applications.
  • It uses UiAutomator/UiAutomator2 (Android) to interact with Android applications.

How It works on the iOS platform

  • .XCUITest(iOS 9.3 and above) or UIAutomation(iOS 9.3 and lower) is part of the instrument’s framework. It interacts with this.
  • Once an Appium client (java or python) connects to the Appium server with desired capabilities as parameters and communicates through JSON wire protocol, the server creates a session. It connects with XCUITest(iOS 9.3 and above) or UIAutomation(iOS 9.3 and lower).
  • XCUITest(iOS 9.3 and above) or UIAutomation(iOS 9.3 and lower) then interacts with bootstrap.js installed in the iOS devices/simulator to perform the actions.

How It works on the Android platform

  • Android Studio has UiAutomator/UiAutomator2, which interacts with Android applications.
  • Once an Appium client (java or python etc .) connects to an Appium server with desired capabilities as parameters and communicates through JSON wire protocol, the server creates a session and connects with UiAutomator/UiAutomator2.
  • UiAutomator/UiAutomator2 then interacts with bootstrap.js installed in the Android devices/simulator to perform the actions.

Prerequisite for setup

Appium tutorial for installing Appium Desktop on Windows

  • Please go to http://appium.io/, and you will see the below screen. Please click on the below-highlighted button. 
Please click on the Appium Download button
Please click on the download button
  • Once you have clicked the above button, you will see the below page. Please click on the highlighted .exe file or .zip file to get it downloaded in your system.
Please download the .exe file or .zip file or windows
Please Download the .zip or exe file
  • Here We have taken the .zip file to install it. Please unzip the file. After that, you will see the image below. Please click on Appium.exe.
Please unzip the file and click on Appium.exe
Unzip the file
  • Now you can see the image below, and you are ready to start your server.
Start The Server
Please start the server
  • Now you can see the image below, and your server is ready.
Server started
Server has started

Appium tutorial for installing Appium Desktop on Mac

  • Please go to http://appium.io/, and you will see the below screen. Please click on the highlighted button shown below.
Download Appium
Please click on download button
  • Once you have clicked the above button, you will see the below page. Please click on the highlighted dmg file to get it downloaded in your system.
Please download the dmg file
Please download the dmg file
  • Please click on the dmg file, which got downloaded recently, and you will see the below screen. Please the instruction mentioned in the below image.
Drag Appium to Application folder
Please drag to Application folder
  • It will start copying in the Application folder.
Copying started
Copying started
  • Suppose you have already installed another version in your system. You will get below pop up. It is your choice to keep both or replace the older one.
You can replace or keep both version
You cab keep both or replace one
  • Once it is installed in your system, you can go to the launchpad and search with Appium, and you will get below icon and click on the icon. Alternatively, you can go to the Application folder and click on the icon.
Please search Appium, and click on the icon
Please search for the icon
  • Many times after launching it, you can get below error messages. No need to worry; we can solve this issue.
Security error
Security error
  • To solve the above issue, you have to go to system preference from the apple icon shown on the top left corner and then click on Security and privacy. You will see the screen below. Please click on “Open Anyway.”
Please go to privacy settings, and click
Please go to privacy settings, and click on Open Anyway
  • Now click on the icon once again and this time, choose to open it. Please follow the below image.
Please Click on Open
Please Click on Open
  • Now you can see the image below, and you are ready to start your server.
Please start the server
Please start the server
  • Please click on the start server to start the server. Your screen will look like below.
Appium Server Started
Server Started

conclusion

Till now We have covered the basics of Appium mobile testing in this Appium Tutorial. In the next topic, We will write about top 20 most used methods to automate native application. For more details on this topic, please refer to this link.

About Himadri Das

Hi, I am Himadri Das, I am a blogger, and an open source contributor. I have about 11 years of experience in the Information Technology domain. Currently I am working in a Startup Company as Quality Assurance Manager. I have hands-on experience on Appium, Selenium, QTP, Locust, Automation framework, Performance Testing, Functional Testing, Java, python, Shell scripting, MySql, Redis, Kafka etc. Apart from my work and writing blogs, I love to play guitar, love to travel and love to watch cricket and football. If you want to know more about me, please visit my linkedin profile - https://www.linkedin.com/in/himadri-das-2b6b7421/.

1 thought on “Appium Tutorial for Mobile Automation- The Comprehensive guide-20-21”

Leave a Comment

Your email address will not be published. Required fields are marked *