Appium is one of the open-source tools which is widely used for automation testing of mobile apps. The tool is used to test apps on iOS and Android platforms. Appium is suitable for testing all kinds of mobile applications, i.e. Native applications build on iOS and Android platforms, hybrid mobile apps, and web browser-based mobile apps.
Are you interested in taking up for Appium Training? Enroll for Free Demo on Appium Training!
Ans: Appium is an open-source tool and it is widely used for mobile application testing. It has a UI testing framework that works for iOS and Android mobile applications. It supports all types of mobile applications, i.e. Native, Hybrid, and Web applications. There is no dependency on the mobile OS.
Appium tool itself has a framework that translates Selenium scripts into UI Automation (iOS) and UIAutomator (Android) commands based on the device type and not by the OS type.
Based on the coding platforms, mobile apps are differentiated as follows:
Native Apps: Native apps are those where the mobile applications are built on iOS SDK and Android SDK.
Hybrid Apps: Using cross-platform coding platforms, the developers will be able to write the code and this can be eventually used for iOS, Android platforms. The codebase will be the same and the users will be able to generate iOS and Android apps separately.
Web Apps: Mobile applications are built in such a way that they access mobile browsers and work exactly like an application. Appium supports the Safari browser for iOS platforms and chrome in the Android platform.
Appium is an HTTP server but written in NodeJS which internally creates and also handles the web driver sessions. If we compare the Appium web server and the Selenium Web Driver, the approach is very similar.
So basically, the Selenium Web driver actually receives the HTTP requests from the client libraries via JSON, and then it handles these requests differently.
[Related Article: Selenium WebDriver Commands]
Appium is nothing but an HTTP server that is written in node.Js
The appium architecture is the same as that of the Selenium Webdriver Server. So, basically, this is how the Appium tool works:
The Appium tool only supports iOS and Android and doesn’t support the Windows platform. The Appium architecture is different from iOS to Android.
So, when the user is downloading the Appium tool, they are actually downloading the server. Further, when the scripts are executed, the HTTP requests go in JSON format to the Appium server. Further, the Appium server sends this information to the instruments. So, if the Appium server sends the commands to iOS devices, then it needs the bootstrap.js file which will help to automate the iOS apps.
In the same manner, if the Appium server sends the commands to Android, then these commands are further sent across to UI Automator. To support UI Automator, the system needs a bootstrap Jar.
Ans: UI Automation API is nothing but a service provided by Apple where the users can write the test scripts and ultimately iOS apps can be automated.
UI Automator API is nothing but a framework developed by Android developers so that the testers can test within the Android interface. The below image will give you a pictorial representation of the Appium Architecture.
JSONWP is nothing but a JSON wire protocol. It is a transport mechanism that is created by web driver developers. For this wire protocol, a standard set of predefined endpoints are made available via RESTful APIs.
Ans: This section of the article will give out information about why testers have to use Appium tool for mobile testing.
In this section of the article, we will be discussing about the basic software that we need to use Appium tool.
The following process will help you understand the step-by-step process to install the Appium tool on your Windows and Mac machines.
Go to the Appium website, http://Appium.io/, and download the tool.
For windows, please download the exe file. If you are working on MAC, then you need to download dmg file.
Once the download is completed, click on the exe and the Appium tool will be installed automatically.
The Appium server popup will be displayed with the default host and port number.
Click on the server start button, based on this, the new server will be launched with the host and port number provided. The user will be able to see the server log output as well.
To initiate a new session, click on the File> New Session Window option
A new window will open up, the user will have an option to enter the Desired capabilities and start a session.
The Appium inspector is only available for iOS and Android. The Appium inspector tool is not available for the Windows platform. Even though the user launches the Appium server, it will fail to launch the inspect elements and ultimately doesn’t work.
The step by step guide will help the user to understand the process is given below:
First of all, download the Appium server.
To top the recording, click on the “Stop” button.
Open “Control Panel”> System and Security> System from the available left panel.
Click on “Advanced Systems Settings” a new window will appear.
Click on “Advanced” tab
Click on “Environment Variables” button available at the bottom of the screen.
Have the mobile testing device handy and connect it to the PC via USB.
Make sure to enable the developer mode on the mobile phone, this needs to be done before automating the application.
The Steps to follow to enable developer mode on Android Phone or Tablet:
So, to automate the android app using Appium, please follow this process:
If we double-check, the essential information for Appium is populated ( the essential information is listed below)
Ans: In order to automate the app, we need to find out the elements that interact with the app. For this, we need to use UI AutomatorViewer.
To find out the contact name use (“android.widget.EditText”)
Ans: The below table shows the common errors that most of the testers encounter while implementation and execution.
|Error||Command to use|
|How to find out XPath in the mobile application?||Using “UIAutomatorviewer” you can find out XPath in the mobile application.|
|Error: could not find adb||The setup process should be appropriate. Within the SDK root directory, “Environment Variables” the “Path” should be configured.|
|Error: Desired name and platform name details are required.||Firstly, the user has to make sure that they add the desired capabilities. For example:
Add device name, platform name in Appium script.
|Session not created exception||The user has to check and apply the correct path and they have to restart the Appium server.|
The below section will discuss all the advantages that Appium tool offers.
The below section will discuss all the disadvantages of Appium tool.
In general, they are a lot of options provided by Appium for mobile app testers, so whether it is a native app or hybrid app, the tool can be used efficiently. With any test automation tool available in the market, they have their advantages and disadvantages, it is the same case with Appium tool. So, while opting for any test automation tool, one has to definitely check the compatibility, and based on the requirement, they can consider using Appium.
Ravindra Savaram is a Content Lead at Mindmajix.com. His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.