Appium Interview Questions

  • Home
  • Appium Interview Questions

 

Appium Interview Questions

 

Here are some of the frequently asked Appium Interview Questions.

If you are interested to learn more about Appium, visit Appium Tutorial

Are you interested in taking up for Appium Training? Enroll for Free Demo on Appium Training

1) Explain what is Appium?
Appium is a freely distributed open source mobile application UI Testing framework. It allows automation of native, mobile web and hybrid mobile applications. Using Appium, we can automate iOS, Android and Windows Phone apps on both emulator/simulator and on physical mobile devices.

2) List out the Appium abilities?
Appium abilities are :
• Supports Automating Mobile Web Applications
• Provides cross-platform for Native and Hybrid mobile automation
• Support JSON wire protocol
• It does not require recompilation of Application
• Support automation test on physical device as well as similar or emulator both
• It has no dependency on mobile device

3) List out the pre-requisite to use APPIUM?
Pre-requisite to use APPIUM is
• ANDROID SDK
• JDK
• TestNG
• Eclipse
• Selenium Server JAR
• Webdriver Language Binding Library
• APPIUM for Windows
• APK App Info On Google Play
• js

4) List out the limitations of using Appium?
• Appium does not support testing of Android Version lower than 4.2
• Limited support for hybrid app testing. E.g., not possible to test the switching action of application from the web app to native and vice-versa
• No support to run Appium Inspector on Microsoft Windows

5) Explain how to find DOM element or xPath in a mobile application?
To find the DOM element use “UIAutomateviewer” to find DOM element for Android application.

6) Explain the design concept of Appium?
• Appium is an “HTTP Server” written using Node.Js platform and drives iOS and Android session using Webdriver JSON wire protocol. Hence, before initializing the Appium Server, Node.js must be pre-installed on the syste

• When Appium is downloaded and installed, then a server is setup on our machine that exposes a REST API
• It receives connection and command request from the client and execute that command on mobile devices (Android / iOS)
• It responds back with HTTP responses. Again, to execute this request, it uses the mobile test automation frameworks to drive the user interface of the apps. Framework like
o Apple Instruments for iOS (Instruments are available only in Xcode 3.0 or later with OS X v10.5 and later)
o Google UIAutomator for Android API level 16 or higher
o Selendroid for Android API level 15 or less

7) What language does Appium support?
Appium support any language that support HTTP request like Java, Java Script with Node.js, Python, Ruby, PHP, Perl, etc.

8) Explain the pros and cons of Appium?
Pros:
• 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
Cons:
• 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

9) Explain what is APPIUM INSPECTOR?
Similar to Selenium IDE record and Playback tool, Appium has an “Inspector” to record and playback. It records and plays native application behavior by inspecting DOM and generates the test scripts in any desired language. However, Appium Inspector does not support Windows and use UIAutomator viewer in its option.

10) Mention what are 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 to the Appium server over HTTP.
• Appium Session: You have to first initialize a session, as such Appium test takes place in the session. Once the Automation is done for one session, it can be ended and wait for another session
• 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.

11) Mention what are the possible errors one might encounter using Appium?
The possible errors one might face in Appium includes
• Error 1: The following desired capabilities are needed but not provided: Device Name, platformName
• Error 2: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
• Error 3: openqa.selenium.SessionNotCreatedException: A new session could not be created
• Error 4: How to find DOM element or XPath in a mobile application?

12) Do you need a server machine to run tests on Appium?
No, you don’t need server machine to run tests on Appium. Appium facilitates a 2-tier architecture where a test machine connects to a test server running Appium and automating the whole thing. You can have Appium running on the same machine where your test runs.

13) Is it possible to interact with my apps using Javascript while I am testing with Appium?
Yes, it is possible to interact with App while using Javascript. When the commands run on Appium, the server will send the script to your app wrapped into an anonymous function to be executed.

14) Mention what are the most difficult scenarios to test with Appium?
The most difficult scenario to test with Appium is data exchange.

15) While using Appium can I run my tests in a multithreaded environment?
Yes, you can run the test in a multithreaded environment but you have to ensure that no more than one test runs at the same time against the same Appium server.

16) In Android, do you need an app’s .apk to automate using Appium or you also need app in my workspace?
In Android, you only need .apk file to automate using Appium.

17) Explain what is Appium package master? How to create package?
Appium package master is a set of tools manage and create appium packages. For example to create package you can use the code
# using es7/babe1
Gulp create-package –n #regular es5
Gulp create-package —nobabe1 –n The package will be generated in the out

18) Explain how test frameworks are supported by Appium?
Appium does not support test framework as such there is no need to support them. Appium can be used with any frameworks you want.

19) What is the underlying API that appium follows?

The underlying selenium API is followed by Appium so that it can automate test cases. It is said that since all the selenium APIs are present in Appium as well so Appium is an extension to the selenium.

20) How can you inspect elements that are present in Native Android App?

With the help of the UIAutomator tool that in present in android SDK, you will be able to access those object locators that are part of the Android Native app.

If you are interested to learn more about Appium, visit Appium Tutorial

21) Mention the method with which you can scroll down in App?

With the help of the scrollTo () method, you will be able to scroll down in App. Also such a method will help you to automatically scroll until the specific text is not match.

22) Is it possible to start an appium server programmatically?

It is possible to start an appium server programmatically. Generally the commands that are being entered to the command prompt are written in note pad and it is saved with .bat extension and you can click the bat file.

22) How can you inspect elements on the IOS apps?

With the help of using appium inspector that is a GUI based tool you can identify elements on IOS apps. These GUI based tools are quite similar to that of selenium IDE.

23) How is it possible to identify Mobile browser objects?

You can make use of User Agent in order to identify objects in Mobile browser. It is done by using the user agent and then changing the browser as the mobile proxy and thus gets an object.

24) Write the command that will allow you to identify objects uniquely when there are multiple objects within the same class name using appium?

With the help of the command driver.findElements (By.className) it is possible to identify the elements uniquely.

25) Give the difference between emulator and simulator?

The simulator is used for calling IOS virtual devices that will launch from Xcode in MAC. The emulator is used for calling Android virtual devices.

26) Do I need Appium?

The answer to such a question is always: “It depends on what you need!”. So the actual question becomes: “Which conditions make Appium suitable for me?”. The most important assumption is that you are developing apps (pretty obvious I know). If you are developing an app for a specific platform (and have no intention of supporting others in future), Appium is not really required and this is basically the answer you are looking for.

Appium becomes meaningful only when you have apps targeting more than one platform (Windows, Android or iOS to cite some). Appium becomes essential if you have a webview-based app (necessarily) targeting many platforms out there.

27) How difficult is it to set up a working environment?

The assumption is that Appium comes with a not-so-tiny documentation, so users are not really left alone. However it is not so straightforward to set up Appium to work on a Windows or Mac machine (did not try on UNIX so far). In my experience, instead of installing the GUI-based application, it is much better to install the command-line application (which is released more often). Also beware [sudo], as Appium will surely bite you back late in time if you installed it as a [superuser] (this is probably the clearest point in the documentation)

28) Can Appium be used for all my tests?

This is an implied question in this question. The answer is No (in general). As I said before Appium is not suitable for all types of tests you might want to write (this depends on the functionalities you need to cover). There are some scenarios that can be difficult to test and some of them are so platform specific that you will need to write some suites just for Android or iOS for example. Remember that you can always get to do something no matter how hard it is, so you can test all your difficult scenarios using Appium, but always keep in mind one question:

is it worth the time and the pain? Having Appium testing some scenarios leaving a few tests to other approaches is fine too! World is not black and white!

29) What is Appium’s most considerable limitation?

Hand down my chin starting thinking and mumbling. If I had to provide one single thing you should be aware of about Appium before starting using it, it would surely be: multiple session handling. Since Appium is a server, it serves HTTP requests; you might have two different computers running a test each against the same Appium server: what happens?

As for now, Appium does not support this scenario and the second test will be aborted. This is a considerable limitation, because no queuing system comes with Appium. If you need to support multiple sessions, you will need to implement this feature by yourself.

30) How active is Appium?

Appium is available on GITHUB and there you can find all you need. The Appium team is responsible for developing many different subsystems revolving around Appium (like APIs for different languages), thus I can tell you that this product is alive and very active. The team is also pretty well responsive and once you open an issue you will find a reply after no more than 36 hours (this ETA comes by my personal experience). The community around Appium is also pretty large and growing every month.

31) Which approach is the best? Testing on real devices or simulators/emulators?

This is a tough question because both options offer different levels of testability and flexibility when testing. There are also many problems associated with each. So my answer will be again: “It depends on your needs!”.
Running test on a device is, always in my opinion, the best solution because it offers a testing environment completely aligned with the running environment: tests run on those devices where your apps will be used once published on stores. However devices must be connected to the Appium server via USB at least, and this is not always a very nice thing.

ADB has a known issue for which a device disconnects after a while (even though it remained plugged all the time): because of this your tests might fail after a while and Appium will report that a device could not be found! I had to write a component which resets ADB after some time so that devices will not disconnect.

32) Tests on emulators or simulators?

On the other hand emulators/simulators will never disconnect from Appium. They also offer nice options like the ability of choosing the orientation or other hardware-related configurations. However your tests will run much slower (sadly, my tests ran 3 times slower) and do expect some crazy behavior from the Android emulator which sometimes shuts down unexpectedly. Another problem is that emulators tend to allocate a lot of memory.

33) 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.

34) 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.

35) 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).

36) 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!

37) Is it possible to interact using Javascript with my apps, while the appium appium tesing running?

Yeah, it is possible! Selenium has commands to execute Javascript instructions on your app from your tests. Basically you can send a JS script from your test to your app; while the running commands on Appium, the server sends the scripting to the apps you used by wrapping into an anonymous function that have to be executed.

38) Is it returning the values?

However your Javascript interaction can get more advanced as your script can return a value which will be delivered to your test when the HTTP response is sent back by Appium once your Javascript has finished running. However this scenario comes with a limitation: your Javascript can send back only primitive types (integers, strings), not complex objects. The limitation can be overtaken by passing objects as JSON strings or by modifying Appium’s or Selenium’s code to support specific objects.

39) 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.

40) 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.

41) What are Testability layers?

In order to make things better, as a developer, what you can do is adding testability layers to your app. The logic behind this approach is simply having some test-related objects in your app which are activated only when your tests run. I learned about this strategy from one of my colleagues Lukasz and such a technique can be really powerful. Enable your testability layers when testing in order to make data exchange easy.

42) Is it exchanging data through Javascript?

Selenium provides commands do execute Javascript on the app, it is also possible to execute functions and have them return data (only basic types). If you exchange JSON strings it should be fine as JSON.stringify(str) will turn yourJSON 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.

43) What are the most difficult scenarios to test with Appium?

Appium is not suitable for all types of tests. There is a particular scenario that will make your tests more difficult to write: data exchange. I already said it but I will repeat the same thing because it is very important: Appium and WebDriver are designed to automate stuff… not to exchange data with them.

So what if we need to exchange information with our app during tests? Should we give up on Appium and write our tests manually for each platform? I am not saying this, but there are cases where you should consider this option (not nice I know, but if the effort of writing tests for Appium is higher than the benefits, than just throw Appium away).

Appium is very nice because it will let you write tests once for all platofrms instead of writing as many tests as the numbers of platforms you need to support. So if you need to exchange data with your app while testing it and this data flow is the same for all platforms, then you should probably keep on using Appium and find a way to write a layer on top of it to handle data. Depending on your needs this might take time, but, in my experience, it is really worth it.

44) I don’t want to set up a whole infrastructure for my tests and I don’t want to spend money on Hard Ware. Can Appium help me?

If you think about it, what really is required from you is writing tests. Then the fact that you must deploy an Appium server somewhere is something more. If you want to skip this part, you can rely on some web services that already deployed a whole architecture of Appium servers for your tests. Most of them are online labs and they support Selenium and Appium.

45) I need to debug Appium, is it difficult?

No really! Appium is a NODE.JS application, so it is Javascript in the essence. The code is available on GITHUB and can be downloaded in few seconds as it is small and not so complex. Depending on what you have to debug, you will probably need to go deeper in your debugging experience, however there are some key points where setting a breakpoint is always worth: the proxy component is worth a mention. In appium/lib/server/proxy.js you can set a breakpoint in function doProxy(req,res), that will be hit everytime commands are sent to platform-specific components to be translated into automation commands.

46) I build my apps with CORDOVA, is it supported by Appium?

CORDOVA is a very famous system that enables you to develop webview-based apps for all platforms in short time. Appium does not explicitly say that Cordova is supported, even though they do it implicitly as some examples using apps built with Cordova are provided on Appium’s website. So the answer is that Cordova should not be a problem. Why am I being so shy about it? Because anything can happen and it actually happened to me!
Cordova and Appium are two different projects that are growing up separately and independently, of course a mutual acknowledgement is present, but both teams do not really talk to each other when pushing features. So problems can occur (I am currently dealing with a problem concerning Cordova’s new version which is causing my tests to fail).

47) What are the basic commands that I can use in the SELENIUM protocol?

Google’s SELENIUM provides a collection of commands to automate your app. With those commands you can basically do the following:
Locate web elements in your webview-based app’s pages by using their ids or class names.
Raise events on located elements like Click().
Type inside textboxes.
Get or set located element’s attributes.
Execute some Javascript code.
Change the context in order to test the native part of your app, or the webview. If your app uses more webviews, you can switch the context to the webview you desire. If your webview has frames or iframes inside, you can change context to one of them.
Detect alert boxes and dismiss or accept them. Be careful about this functionality, I experienced some problems.

48) I want to run my tests in a multithreaded environment, any problems with that?

Yes! You need some special care when using Appium in a multithreaded environment. The problem does not really 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. As I mentioned, Appium does not support multiple sessions, and unless you implemented an additional layer on top of it to handle this case, some tests might fail.

49) How can I run Android tests without Appium?

In older versions of Android Appium might not be supported. For instance, Appium is only supported in Android versions 4.4 or later for MOBILE WEB APPLICATION tests, and Android versions 2.3, 4.0 and later for MOBILE NATIVE APPLICATION and MOBILE HYBRID APPLICATION tests.

So for those versions in which Appium is not supported you can request an emulator driven by Webdriver + Selendroid. All you need to do is use our PLATFORMS CONFIGURATOR and select Selenium for the API instead of Appium.
In the Sauce Labs test you will notice that the top of the emulator says “AndroidDriver Webview App”. With addition, you will notice that you will get a “Selenium Log” tab which has the output of the Selendroid driver.
With an emulator driven by Webdriver + Selendroid you will be able to testMOBILE WEB APPLICATION only. You should be able to select any Android emulator version from 4.0 to the latest version and any Android emulator skin (e.g “deviceName”:”Samsung Galaxy Tab 3 Emulator”).

50) How can I run iOS tests without Appium?

In older versions of iOS Appium might not be supported. For instance, Appium is supported in iOS versions 6.1 and later. For earlier versions of iOS the tool or driver used to drive your mobile applications automated test is called iWebdriver.
To obtain a simulator driven by iWebdriver use our PLATFORMS CONFIGURATOR and select Selenium for the API instead of Appium. With an emulator driven by iWebdriver you will be able to test MOBILE WEB APPLICATION only. In addition, in the Sauce Labs test you will notice a “Selenium Log” tab which has the output of iWebdriver.

51) What mobile web browsers can I automate in the Android emulator?

Currently the only browser that can be automated in our Android emulators is the stock browser (i.e Browser). The Android stock browser is an Android flavor of ‘chromium’ which presumably implies that its behavior is closer to that of Google Chrome.

52) Do I Need A Server Machine To Run Tests On Appium?

No! Appium promotes a 2-tier architecture where a test machine connects to a test server running Appium and automating the whole thing. However this configuration is not mandatory, you can have Appium running on the same machine where your test runs. Instead of connecting to a remote host, your test will connect to Appium using the loopback address.

53) Explain How To Find Dom Element Or Xpath In A Mobile Application?

To find the DOM element use “UIAutomateviewer” to find DOM element for Android application.

54) 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.

55) Can I Interact With My Apps Using Javascript While I Am Testing With Appium?

Yes! Selenium has commands to execute Javascript instructions on your app from your tests. Basically you can send a JS script from your test to your app; when the commands runs on Appium, the server will send the script to your app wrapped into an anonymous function to be executed.

56) 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.

57) 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.

Visit other software testing Interview Questions..

Manual Testing Interview Questions
Performance Testing Interview Questions
Selenium Interview Questions
Mobile Apps Testing Interview Questions

Subscribe now

Receive weekly newsletter with educational materials, new courses, most popular posts, popular books and much more!