30+ TOP Appium Interview Questions and Answers
1. What do you know about Appium?
Appium is a well documented open-source automation tool for executing scripts and testing native applications and hybrid applications on both Android and iOS which uses web drivers to operate. It is a very budding company that has gained many users in a short interval of time. Appium philosophy says that :
The application which is submitted to the marketplace should be tested only.
Writing tests in any framework and in any language which is compatible.
Aim to build a large open-source community effort.
A standard automation specification and API must be used.
2. What are native Apps?
An open source tool that is required for mobile web, automating Native and hybrid application on Android and IOS platform is known as Appium which was in 2012. Appium is considered to be a cross-platform that will low you to write tests that are on multiple platforms like Android and IOS. They do this using the same API. This facility will enable you to do reuse codes between Android and IOS test sites.
Those Apps are written by using Android SDKs and IOS are known as Native Apps.
3. What are Mobile Web Apps?
There are mobile web pages that are those web apps that are accessed with mobile browsers. In the case of the IOS platform, Appium supports Safari and for the Android platform, Chrome or any other built-in browser is used.
4. What are hybrid apps?
Those apps that are equipped with a wrapper around the web view is known as a Hybrid app. This is native control that will facilitate the interaction with the web content.
5. Name the language that is used to write tests in Appium?
The tests of Appium are written is any language and this is because appium is nothing but an HTTP server. It is also important that the test should be interfaced with Appium and it uses HTTP libraries so that they can create HTTP sessions.
In order to create the right commands in Appium then all, you need to know Selenium protocol.
6. Which are the prerequisites to use Appium?
The pre-requisites that are used in Appium. They are listed below.
1. Eclipse IDE
2. Android SDK
4. Web driver language binding library
7. APK App Info on Google play
8. Selenium server jar
9. Appium for Windows
7. Write the advantages of using Appium.
The advantages of Appium are listed below:
1. Using the same API, Appium will allow you to write tests that are against mobile platforms.
2. By using any kind of test framework or language you can write and run the tests.
3. Appium is an open source platform so you can contribute to it easily.
4. For the hybrid mobile applications and Native, Appium provides cross-platform.
5. Appium supports the JSON wire protocol.
6. Appium does not require recompilation of App.
7. Appium also supports automation tests on the physical devices and also for simulator or emulator both.
8. Appium does not have any dependency on mobile devices.
8. Name the test frameworks that are supported by Appium.
Test frameworks are not supported by appium since there is no need to do it. All test frameworks can be used by Appium. Some examples are .net unit test and NUnit. A test for Appium is written using one of the drivers so that the tests can interface with the appium in case of external dependency.
9. Write down the disadvantages of Appium?
The disadvantages of Appium are listed below:
1. The testing of that android that is lower than 4.2 is not allowed.
2. Appium has limited support for hybrid app testing. You will not be able to test the action that allows switching of applications from native to web app and from web app to native.
3. There is no support that will allow you to run an Appium Inspector on Microsoft Windows.
10. What are the requirements to write Appium tests?
There are certain basic requirements when it comes to writing Appium tests and they are:
1. Driver client – Mobile applications are driven by Appium like that of a user. With the help of a client library, Appium tests can be written and these will wrap the steps of a test and then send it to Appium over the HTTP.
2. Appium Session – Appium tests take place within a session so it is important to initialize an appium session first. Once there is an end to the automation of a session it will be ended and wait again for the next session.
3. The desired capabilities – In order to initialize an appium session it is very important to design some parameters which are known as desired parameters. These parameters are platform version, platform name, device name and many more. This also helps in specifying the type of automation that is required from the Appium server.
4. Driver Command – In Appium you have the facility to write the tests by using a big and expressive collection of commands.
11. Name the different types of mobile applications present in today’s era
Mobile applications can be broadly classified into three main categories in today’s era which are as follows :
Native mobile applications: The mobile apps which are developed for a particular platform and also developed with a specific programming language and are available for download in the Google Play Store for Android users and App Store for iOS users are called native applications. For example Candy Crush, tinder, etc.
Web application: Web applications are kind of mobile web portals that are designed, prepared and customized only for mobile users. These are not available for download but are available on the web browsers of mobile phones for usage. For example m.yahoo.com, m.snapdeal.com, etc.
Hybrid application: Hybrid applications are made by combining the best features of both native and web applications. These are the web apps that are embedded in the native app which runs on the device.
12. If someone already has platform-specific tests, should he/she migrate to Appium and why?
Unfortunately, there is no propaganda or medium to translate normal tests into Selenium tests i.e tests performed by Appium. Current tests can be easy to migrate if they are following a self automation process as Appium does otherwise it is a tough job to migrate to Appium. If someone already has performed specific tests, then in general views, he/she has to rewrite the code from the beginning in order to test it with Appium.
13. How much time it will take to write a test in Appium?
It totally depends on the test which is to be performed. If the test simply runs a scenario, it will take commands of very few lines and also very less interaction will be needed in order to test that application whereas if the test is complex and requires transfer of data it will take much more time than the previous one and also it will be a little difficult to read the lines of code of that test.
This discussion can be concluded by saying that there is only one factor on which the time needed depends which is the complexity of the test and it is directly proportional to the time taken in Appium.
14. Explain the risks associated with Appium testing.
There are many risks associated with Appium testing which are as follows :
Availability of skilled resources: Automation testing demands-resources which must be skilled and have some knowledge about programming.
Cost of automation is high initially: The cost of automation is initially too high as it includes many things such as cost of automation tools to be purchased, training and maintenance of various test scripts.
First, the UI has to be fixed mandatorily before automation: Before automation, it is compulsory to fix the user interface and keep a check whether the UI is changing extensively and the cost of automation and maintenance.
Tests that have been run once should be stopped automating: To avoid ambiguity, test modules that have been run once should be stopped automating.
15. Do you know about the Appium inspector? Why is it used?
Appium inspector is very similar to the Selenium IDE plugin. Appium inspector has a great advantage of recording and playback support. It is basically used to capture the moves of the native application by inspecting DOS and producing test scripts in any programming language which is compatible with the user. But, the Appium inspector does not support Windows and works only viewers.
16. Name the types of errors that you can face in Appium.
1. Error type one: These types of errors occur when there is the need for desired capabilities but they are not provided. Missing of Device name or platform name is considered to be part of this error type.
2. Error type two: These types of errors occur when you cannot find adb. To avoid this type of error can be avoided by setting the Android Home environment variable with the Android SDK root directory path.
3. Error type three: This falls under the category of penqa.selenium.Session Not Created Exception which will not allow you to create a new session.
17. Is there a need for a server machine to run tests on Appium?
In order to run tests on Appium there is no need for a server machine. The 2-tier architecture is facilitated with Appium. It is in this 2-tier architecture that the test machine gets connected to a test server which is running on Appium and also automating the whole thing. Appium can be run on the same machine where you are running the tests.
19. What are the most difficult scenarios that one might face while testing Appium?
Data exchange is the most difficult scenario that one might face while testing Appium.
20. Is it possible to run tests in a multithreaded environment while you are using Appium?
It is indeed possible to run tests on the multithreaded environment but you have to make sure that no two tests are running simultaneously on the same Appium server.
21. Explain The Pros And Cons Of Appium?
For programmer irrespective of the platform, he is automating ( Android or iOS) all the complexities will remain under single Appium server
It opens the door to cross-platform mobile testing which means the same test would work on multiple platforms
Appium does not require extra components in your App to make it automation friendly
It can automate Hybrid, Web and Native mobile applications
Running scripts on multiple iOS simulators at the same time is possible with Appium
It uses UIAutomator for Android Automation which supports only Android SDK platform, API 16 or higher and to support the older API’s they have used another open source library called Selendroid.
22. I Already Have Platform-specific Tests For My App, What Should I Do To Migrate To Appium?
Unfortunately there is not a magic formula to translate your tests into Selenium tests. If you developed a test framework on different layers and observed good programming principles, you should be able to act on some components in your tests in order to migrate your suites to Appium.
Your current tests are going to be easy to migrate if they are already using an automation framework or something close to a command-based interaction. Truth being told, you will probably need to write your tests from the beginning, what you can do is actually reusing your existing components.
23. How Much Time Does It Take To Write A Test In Appium?
Of course it depends by the test. If your test simply runs a scenario, it will take as many commands as the number of interactions needed to be performed (thus very few lines). If you are trying to exchange data, then your test will take more time for sure and the test will also become difficult to read.
24. Any Tips Or Tricks To Speed Up My Test Writing Activity Or My Migration Process?
Here is one piece of advice. Since your tests will mostly consist in automation tasks (if this condition is not met, you might want to reconsider using Appium), make interactions reusable! Do not write the same sub-scenarios twice in your tests, make a diagram of what your scenarios are and split them in sub activities; you will get a graph where some nodes are reachable from more than one node.
So make those tasks parametric and call them in your tests! This will make your test writing experience better even when you need to migrate from existing tests (hopefully you already did this activity for your existing suites).
25. What Test Frameworks Are Supported By Appium?
Appium does not support test frameworks because there is no need to support them! You can use Appium with all test frameworks you want. NUnit and .NET Unit Test Framework are just a few examples; you will write your tests using one of the drivers for Appium; thus your tests will interface with Appium just in terms of an external dependency. Use whatever test framework you want!
27. Is It Returning The Values?
28. How Can I Exchange Data Between My Test And The App I Am Testing?
Appium, actually the WebDriver specification, is not made for exchanging data with your app, it is made to automate it. For this reason, you will probably be surprised in finding data exchange not so easy. Actually it is not impossible to exchange data with your app , however it will require you to build more layers of testability.
29. What Data Exchange Is?
When I say “data exchange” I am not referring to scenarios like getting or setting the value of a textbox. I am also not referring to getting or setting the value of an element’s attribute. All these things are easy to achieve in Appium as Selenium provides commands just for those. By “data exchange” I mean exchanging information hosted by complex objects stored in different parts of your webview-based app like the window object.
Consider when you dispatch and capture events, your app can possibly do many things and the ways data flows can be handled are many. Some objects might also have a state and the state machine behind some scenarios in your app can be large and articulated. For all these reasons you might experience problems when testing.
If you exchange JSON strings it should be fine as JSON.stringify(str) will turn your JSON string into an object on the app side, while on the test side (depending on the language you are using), you can rely on hundreds of libraries to parse the string you receive.