May 4, 2020 Jonny Steiner

Answers to 20 of the Most Common Appium Interview Questions

Share this knowledge!

We at Experitest work with Appium a lot. For years we have worked to provide seamless integration into Appium to allow testers to create Appium automation in minutes. Naturally, this has led to us working with and hiring a lot of Appium specialists. In our interviews with potential employees we find ourselves asking a lot of the same interview questions about Appium and its capabilities. We thought that it would be a good idea to prepare a Q&A about Appium where we can answer some of the most common Appium interview questions upfront. Read on and give yourself a head-start when interviewing for Appium related positions.

So without any further ado please have a look below at the most common:

Appium Interview Questions and Answers

1. What is Appium?
2. Types of Mobile Applications and a short description of each of them?
3. Prerequisites for Appium.
4. Explain the Basic Architecture of Appium.
5. Advantages of Appium
6. Difference between Selenium and Appium?
7. Disadvantages of Appium?
8. Basic steps to write the Appium Test.
9. What are the Desired Capabilities?
10. What are the Mandatory properties (key-value pairs) in Desired Capabilities?
11. What is the Appium Inspector?
12. What are Locators in Appium and give some examples of Locators?
13. What is XPATH and how can it be used to locate elements?
14. What is the difference between FindElement and FindElements and How can we check the availability of an Element?
15. What is Explicit and Implicit wait in Appium?
16. Using Appium how can we test the Element which is not visible at a specific testing time?
17. Is it possible to perform Swipe action using Appium? If yes, how?
18. List some common mistakes while authoring Appium Tests.
19. List some common Exceptions in Appium?
20. How can we debug the Appium Test?

1. What is Appium?

Appium is an open-source test automation framework. We use Appium to automate mobile apps on Android and iOS platforms.

2. Types of Mobile Applications and a short description of each of them?

  1. Native apps – Application developed for a specific platform.
  2. Hybrid apps – Applications that have both Native and Web components but run as an application.
  3. Web Application – Applications built to run on Browsers (In this case, Mobile browsers).

 

3. Prerequisites for Appium.

  1. Installation of Android Studio for automating Android and XCUI for iOS automation.
  2. NodeJS
  3. Corresponding Language Runtimes for Appium Clients. An example for Java Appium Client JDK/JRE is a prerequisite.

 

4. Explain the Basic Architecture of Appium.

At the heart of Appium tool, its key components are,

  1. Appium Server – An HTTP Server that listens to the Appium Http based clients and uses its UI Automator driver to translate automation commands to language which Android devices can understand.
  2. Appium framework exposes Appium Clients for different languages like Java, Python. The Appium Clients list all of the supported languages.
  3. Appium supports different drivers to automate various end platforms. UIAutomator2 Driver is used to support the Android Operating system.

 

5. Advantages of Appium

  1. Cross-Platform
  2. Appium exposes a single API for automating mobile applications in different platforms.
  3. Appium supports many different languages using which automation tests can be developed. API’s follow similar overall concepts for automation.
  4. Appium is based on Selenium’s Web Driver protocol.
  5. Appium provides end-to-end automation support for automation like Appium Server runtime, Appium Client libraries for development, and UI Inspector to find the location of UI elements.

 

6. Difference between Selenium and Appium?

Selenium is an open-source tool that allows automation for Web applications run in Browsers. Appium is used for automating mobile applications and web applications which run on mobile devices.

7. Disadvantages of Appium?

  1. The commands are generally translated to the actual device which affects the performance.
  2. No support available for testing on Android devices lower than version 4.2.

 

8. Basic steps to write the Appium Test.

  1. Decide on the programming language which Appium Client library supports.
  2. Decide on the Testing framework of underlying development language. Example: TestNG for Java language.
  3. Import the Appium Client library
  4. Initialize the driver and pass Desired Capabilities (Session properties)
  5. Locate the UI elements in the Mobile application. Use the Appium Inspector to get the location beforehand.
  6. Execute the automation command on the Element.
  7. Quit the initialized driver.

 

9. What are the Desired Capabilities?

Desired Capabilities are keys and values encoded in a JSON object, sent by Appium clients to the server when a new automation session is requested. They tell the Appium drivers all kinds of important things about how you want your test to work.

Each Appium client builds capabilities in a way specific to the client’s language, but at the end of the day, they are sent over to Appium as JSON objects.

10. What are the Mandatory properties (key-value pairs) in Desired Capabilities?

  1. deviceName – Identification ID for the mobile device connected.
  2. platformName – Operating System for the Mobile device.
  3. app – Path of the mobile application to be automated.

 

11. What is the Appium Inspector?

Appium inspector is an out of the box utility provided by Appium Framework to load a Mobile application and locate any element of the Mobile Application.

12. What are Locators in Appium and give some examples of Locators?

Elements of the Mobile Applications can be identified by some properties. Although there are some properties specific to the application, there are some which are more standard in nature. These standard properties are sometimes called Locators.

Following are the examples of Locators:

  1. ID
  2. name
  3. className
  4. accesibilityID
  5. XPath

 

13. What is XPATH and how can it be used to locate elements?

In general, XPATH enables testers to navigate through the XML structure of any document, and this can be used on both HTML and XML documents.

XPATH has a specific syntax to reach any element. This is a String-based identifier for any element.

Appium provides a ‘FindBy’ function where an XPATH string can be passed and the element is returned.

14. What is the difference between FindElement and FindElements and How can we check the availability of an Element?

Find Element is used to locate one specific element in an application UI screen and Find Elements can be used to locate multiple elements. We can use findElements functions to check the availability of elements.

Boolean iselementpresent = driver.findElementsByName(“App”).size() != 0

Also very important, findElement will throw an exception if no elements are found where findElements will not throw an exception and will return a 0 size array of elements.

15. What is Explicit and Implicit wait in Appium?

There are times when some elements do not load on the application screen at the time of testing. Situations like these require a delay or wait for a specific test on the element in question.

Appium provides the following:

  • Implicit wait – Delay added for a specific time.
  • Explicit wait – Delay added for a specific condition.

 

16. Using Appium how can we test the Element which is not visible at a specific testing time?

Appium provides Explicit wait/Expected conditions for accomplishing this task.

Example:

WebDriverWait wait = new WebDriverWait(driver,20);
wait.until(ExpectedConditions.visibilityOfElementLocated(“”)

The second option is to use the findElements as explain in the previous question.

17. Is it possible to perform Swipe action using Appium? If yes, how?

Yes, it is possible.

Appium provides TouchAction API to perform Swipe action.

Example:
TouchAction myAction = new TouchAction((MobileDriver)driver);
Dimension size = driver.manage().window().getSize();
int startY = (int) (size.height * 0.85);
int endY = (int) (size.width * 0.05);
int coordX = (int) (size.width * 0.50);
myAction.press(coordX,startY).waitAction(3000).moveTo(coordX,endY).release().perform();

18. List some common mistakes while authoring Appium Tests.

  1. Unrestricted X Path Usage – Over usage of XPATH as locators.
  2. Neglected usage of Accessibility IDs: – The accessibility ID locator strategy is formulated to read a unique identifier for a UI element. For both iOS and Android, getting an element by their accessibility ID is the best method.
  3. Query for every element visibility – Querying for each element’s visibility is not a good idea as it affects performance. Only important and elements which may not get visibility should be queried.

 

19. List some common Exceptions in Appium?

  1. SessionNotFoundException – Thrown when Appium Connection is disconnected or session not established.
  2. ElementNotFoundException – Thrown when you attempt to find an Element and then the element is not Found.
  3. WebDriverException – Thrown when the Driver is not existent.

 

20. How can we debug an Appium Test?

  1. Appium provides the server logs, which gives some hints on the error.
  2. The tests can be generally debugged using underlying Language/IDE.

Example: Java Remote debugging can be used to debug the tests.

Appium can be a complex and difficult test automation framework to learn and practice. That is why we ask potential employees so many Appium interview questions. This article is meant to give you some answers to the most common Appium interview questions. We hope it helps you find and succeed in your next role.

Guy ArieliCTO

 

Share this knowledge!