Appium Interview Questions & Answers
Appium is the most sought after automation tool in the market, demanding companies to recruit Appium professionals in the industry. We have created a list of the most frequently asked questions and answers to help people crack the interview easily.
1. What is the purpose of Appium?
Appium is a freeware open-source test automation framework designed to help testers run mobile applications on two major platforms like android and IOs. It helps test the UI of any application.
2. List the main difference between Selenium and Appium.
Selenium deals with the automation of web-based applications on browsers, while Appium is primarily designed for testing both mobile and web applications that run on mobile devices.
3. What are the pros of using Appium?
- It is a cross-browser testing tool for checking the compatibility of applications on different mobile platforms.
- The tool offers multi-lingual support, which is beneficial for creating automation tests.
- Capability to handle web, native, and hybrid mobile applications.
- Does not need any additional components in your app to make it automation friendly.
- No need to alter the source code of the application.
4. What are the cons of using Appium?
- Appium is not compatible with devices that own an android version of less than 4.2
- The tool is not beginner-friendly and requires training from experienced professionals.
- Operates under a low performance due to translation of commands to the actual device.
- Testing on MAC environment simultaneously requires multiple machines.
5. Is it possible to run tests in a multithreaded environment using Appium?
Yes, it is feasible, but one needs to ensure that not more than one test runs on the Appium server.
6. What are the test automation frameworks compatible with Appium?
Dot net unit test and NUnit are the two main frameworks supported by this tool. However, Appium runs on any other framework you want without any restrictions.
7. What are the pre-requisites to use Appium?
Listed below are the requirements to use Appium.
- Installation of Android SDK tools.
- Installation of Java.
- Installation of Eclipse IDE.
- Installation of Appium desktop-based client.
- Installation of Android Studio.
8. What are the languages supported by the Appium tool?
Appium works on multiple languages like Java, JavaScript with Node.js, Python, Ruby, PHP, and Perl.
9. Describe in short about Appium inspector
Appium framework supports an inspector that takes care of the record and playback functionality just like its competitor tool Selenium. It can locate any desired element on the mobile application by monitoring the DOM and auto-generating the test scripts in any language. But, one drawback is that it is not compatible with Windows and instead uses UIAutomator viewer to run significant functionalities.
10. Which scenario is not possible to test with Appium?
One challenging scenario to test with Appium is data exchange as it involves too many complexities. Appium does not hold suitable for data exchange but only to automate the pre-written test scripts.
11. How to debug using the Appium tool?
Appium makes tracking on the server logs, which displays the errors explicitly on the screen. For instance, Java Remote debugging can be used to debug the tests. The tests can be run via the IDE as well.
12. List out the basic requirements for writing Appium tests.
- Driver Client– Appium handles mobile applications with ease by utilizing the client library to create tests to test steps. It then forwards the test steps to the Appium server through the HTTP channel for further execution.
- Appium Session– This is where the tests are being executed in real-time, and so it is essential to launch the session. As soon as the automation process is done, the session can be called off or disconnected.
- Desired Capabilities– Desired capabilities are pre-requisite parameters that need to be set before launching an Appium session. These parameters may include PlatformName, PlatformVersion, Device Name, etc.
- Driver Instructions– Driver instructions are a set of commands that drive the testers through the test execution process by serving as guides for them to create test steps effectively.
13. List out the errors spotted by Appium.
Different errors may occur while using Appium for test automation, which is listed below.
- Few mandatory parameters are needed but not entered: DeviceName, PlatformName.
- I could not find the ADB. Please specify the ANDROID_HOME environment parameter with the respective directory path.
- Openqa.selenium.SessionNotCreatedException- Failed to create a new session.
14. How to find the DOM element or XPath in a mobile application?
Please list the Selenium commands that correlate with Appium.
- Locate commands, including ID and class names.
- Event creation elements like Click ().
- Text related commands that include type ().
- Get and set properties of the element.
- JavaScript-based commands.
- Commands relating to popups or message box alerts.
- Switching views in Selenium Web driver like iFrames.
15. How to execute android tests without Appium?
For devices having an Appium version lesser than 4.4, users can access the emulator supported by Webdriver and Selendroid to run and test the mobile applications. The execution can be achieved by adapting the Platforms configurator by selecting the Selenium instead of API.
16. List out the feasibilities of Appium.
- It is helpful for testing web-based applications in a fast-paced environment.
- Eliminates the need for recompilation of the Appium app.
- Allows test automation on both actual devices as well as an emulator.
- Reduces the dependency on mobile equipment.
17. Is a server machine mandatory for running tests on the automation tool?
Appium works on the concept of 2-tier architecture wherein connectivity is established between the test machine and the test server that automates the tests on the Appium. It is possible to have a shared environment for both Appium and the test to be executed.
18. What are mobile browsers can be automated using the Android emulator?
The stock browser is the only platform supporting automation in Android emulators resembling Google Chrome.
19. Is integration with apps possible with Javascript while using Appium automation framework?
Yes it is feasible for app to interact with JavaScript during the command execution on the automation framework. The server sends the test script to the app requesting for the test execution.
20. What file is mandatory in android device to automate a test script on Appium?
.apk file is mandatory to run the test script using Appium.
21. What Is Appium Inspector And Why Is It Used?
It is similar to the Selenium IDE plugin and enables the record and playback support in Appium. It captures the moves of a native application by inspecting DOM and produces the test scripts in any desired language. However, Appium Inspector does not support Windows and uses the <UIAutomator> viewer.
22. What Are The Probable Errors You Might Come Across While Working With Appium?
The following are the errors you might observe with Appium.
- Error#1: Missing desired capabilities e.g. Device Name, PlatformName.
- Error#2: Couldn’t locate ADB. You may have missed setting the <ANDROID_HOME> environment variable.
- Error#3: Selenium exception <openqa.selenium.SessionNotCreatedException>. It indicates a failure in creating a new session.
- Error#4: Failure in locating a DOM element or determining the XPath.
23. What Are The Problems Faced While Running A Test In A Multithreaded Environment?
You need special care while using Appium in a multithreaded environment. The problem does not rely on the fact of using threads in your tests. You can use them but, you must ensure that no more than one test runs at the same time against the same Appium server. Appium does not support multiple sessions, and unless you have implemented an additional layer on top of it to handle this case, multiple tests might fail.
24. List The Selenium Commands That Work With Appium.
There are a number of Selenium commands that work with Appium tool.
- Locate commands using ID or class names.
- Raise events on elements e.g. Click().
- Text commands like type().
- Get/Set element properties.
- Commands to run JavaScript.
- Switch context between different web views like switching <iFrames> in Selenium Webdriver.
- Commands to manage alert boxes
25. List OneThing Which You Cannot Do With Emulators But You Can Do With A Real Device.
You can test the interrupts like
- Phone calls & Messages
- Battery drains out while using the application under test
- Low battery scenarios
- Memory card mount/unmount scenarios
- Actual performance of your application
- Bluetooth related testing.
26. Which Tools Are For Performance Testing And Automation?
For performance testing of web services, you can use JMeter. It is an open-source tool which can be used to test the API’s performances.
For automation, there are several paid tools available in the market like SeeTest, Ranorex, Silk Mobile etc while free automation tools are Calabash, Appium, Robotium for Android, KIF for iOS.
27. What Are The Tools Used In Debugging?
We generally use logs to see the cause of the issue, where the failure is occurring. So for iOS – iPhone configuration utility & for Android Monitor.bat, etc can be used. If you provide logs from these tools to the developer, they can easily understand the cause of the issue.
28. Mention The Basic Requirement For Writing Appium Tests.
For writing Appium tests you require:
- Driver Client: Appium drives mobile applications as though it were a user. Using a client library you write your Appium tests which wrap your test steps and sends them to the Appium server over HTTP.
- Appium Session: You have to first initialize a session, as such Appium test takes place in that session. Once the Automation is done for one session, it can be ended.
- Desired Capabilities: To initialize an Appium session you need to define certain parameters known as “desired capabilities” like PlatformName, PlatformVersion, Device Name and so on. It specifies the kind of automation one requires from the Appium server.
- Driver Commands: You can write your test steps using a large and expressive vocabulary of commands.
29. What Are The Risks Associated In Automation Testing?
The risks of Automation Testing are:
- Do you have skilled resources? Automation testing demands resources with some knowledge about programming. Firstly, focus on resources and then identify whether the resources have proper knowledge for automation testing. Are they capable to adapt easily to the new technologies? These measures are to be well assessed for building an automation testing team.
- The initial cost for automation is high. The initial cost for automation is too high for the initial setup. It includes the cost of automated tools to be purchased, training and maintenance of the test scripts. The unsatisfied customer base is high for automation testing their products. It should be ensured that the cost compensates the testing results.
- If UI is not fixed, do not think about automation: Prior to automating the user interface, it should be strongly be determined that, whether the UI is changing extensively or the cost of the automated script maintenance is high or not.
- Stop automating the tests which run once: Ensure that certain test cases might be running once and not included in the regression testing. Avoid automating such test modules.