
1) Explain what is Appium?
Appium is a freely distributed open source mobile application UI Testing framework.
2) List out the Appium abilities?
Appium abilities are
- Test Web
- Provides cross-platform for Native and Hybrid mobile automation
- Support JSON wire protocol
- It does not require recompilation of App
- 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 system
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
Apple Instruments for iOS (Instruments are available only in Xcode 3.0 or later with OS X v10.5 and later)
Google UIAutomator for Android API level 16 or higher
Selendroid for Android API level 15 or less
7) What language does Appium support?
Appium support any language that support HTTP request like Java, JavaScript 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) What Are The Advantages Of Using Appium?
- It allows you to write tests against multiple mobile platforms using the same API.
- You can write and run your tests using any language or test framework.
- It is an open-source tool that you can easily contribute to.
17) What Is Appium’s Strongest Point?
Appium is based on Selenium which is an HTTP protocol by Google designed to automate browsers. The idea is actually very nice as automating an app (especially a webview-based one) is not so different (in terms of required APIs) from automating a browser.
Appium is also designed to encourage a 2-tier architecture: a machine runs the test written in one language ([csharp], [ruby], [javascript] are only a few among the many supported ones) and another one (the test server) actually executes it. Furthermore the WebDriver protocol targets scalability (because based on HTTP), this makes Appium very scalable as well; remember that you will need to write your test once, Appium will be in charge of executing it on more platforms.
18) What Is The Appium Philosophy?
R1. Test the same app you submit to the marketplace
R2. Write your tests in any language, using any framework
R3. Use a standard automation specification and API
R4. Build a large and thriving open-source community effort
19) Why Do The Appium Clients Exist?
We have the Appium clients for 3 reasons:
1) There wasn’t time to go through a full commit and release cycle for Selenium once we’d set a release date for 1.0
2) Some of the things that Appium does, and which its users really find useful, are never going to be an official part of the new mobile spec. We want a way to make these extensions available
3) There are some behaviors whose state is as yet unknown. They might make it into the spec and get deleted from the clients, or they might be in category #2
Ultimately, the only reason for the clients will be #2. And even that is actually evidence that we are conforming to the WebDriver spec (by implementing the extension strategy it recommends) rather than departing from it. The Appium clients are the easiest and cleanest way to use Appium.
20) What Language Does Appium Support?
Appium support any language that support HTTP request like Java, JavaScript with Node.js, Python, Ruby, PHP, Perl, etc.
21) What Are Main Advantages Of Using Appium On Sauce Labs?
- You save the time it takes to set up the Appium server locally.
- You don’t have to install/configure the mobile emulators/simulators in your local environment.
- You don’t have to make any modifications to the source code of your application.
- You can start scaling your tests instantly.
22) Which Language Should I Use To Write My Tests?
This is probably the best thing about Appium: you can write your tests in any language. Since Appium is nothing more than an HTTP server, a test which needs to be interfaced with Appium can simply use HTTP libraries to create HTTP sessions. You just need to know the Selenium protocol in order to compose the right commands and that’s it!
However, as you can imagine, there are already some libraries doing this for the most common languages and development frameworks out there: C#, [dotnet], [java], Ruby, [python] and Javascript are just few examples; and they all are open source projects.
23) What Type Of Tests Are Suitable For Appium?
When it comes to testing, especially webview-based apps, there are a lot of scenarios that can be tested also depending on the feature coverage you want to ensure. Appium is pretty handy for testing scenarios that users will go through when using your app.
But if you need to test more than UX simple interactions, then Appium will become a limitation. Think about features like keyboarding. It is not so easy when complex touch/keyboard mixed scenarios are involved, the probability of a false failure is high; do not misunderstand me on this: I am not saying it is impossible to do, just not so easy as you might think!
Another little nightmare with Appium is exchanging data. When your test needs to exchange data with your app (especially in the incoming direction), you will need to play some tricks. So always consider that sending and receiving information is not that straightforward. It is not Appium’s fault, the WebDriver specification was designed for automating stuff, not exchanging data!
24) List Out The Appium Abilities?
Appium abilities are:
- Test Web
- Provides cross-platform for Native and Hybrid mobile automation
- Support JSON wire protocol
- It does not require recompilation of App
- Support automation test on physical device as well as similar or emulator both
- It has no dependency on mobile device.
25) 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
26) What About Performance?
Appium is not a huge application and requires very little memory. Its architecture is actually pretty simple and light as Appium acts like a proxy between your test machine and each platform automation toolkit. Once up and running, Appium will listen to HTTP requests from your tests; when a new session is created, a component in Appium’s Node.js code called proxy will forward these Selenium commands to active platform drivers.
In the case of Android for example, Appium will forward incoming commands to the [chromedriver] (90% of cases, Appium will not even change commands while routing them), this happens because ChromeDriver supports WebDriver and Selenium. For this reason Appium will not allocate much memory itself, you will see a lot of memory being allocated by other processes like [adb], ChromeDriver or the iOS automation toolkit (called by Appium while testing and automating).
27) What Platforms Are Supported?
Appium currently supports Android and iOS, no support for Windows unfortunately.
28) 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.
29) 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.
30) How Can I Test Android Tablets?
The best way to test on different Android emulators screen sizes is by using the different Android Emulator Skins . For instance, if you use our Platforms Configurator you’ll see the available skins for the different Android versions (e.g Google Nexus 7 HD, LG Nexus 4, Samsung Galaxy Nexus, Samsung Galaxy S3, etc). Some of these skins are tablets, for example the Google Nexus 7C is a tablet which has a very large resolution and very high density.
31) What are the supported languages in Appium??
Appium allows clients to interact with Appium based on sessions. Clients send session requests as a form of POST and pass desired capabilities as a parameter. There are multiple clients like Java, JavaScript, PHP, Ruby, Python, and C#.
32) List out the Appium supported Automation and Unit Test Framework ?
We can use all type of test frameworks with Appium. For example, java unit, java TestNG, NUnit etc as unit test framework . Appium test implements the Selenium webDriver to interact with Android or iOS devices.
33) How can you verify elements on the iOS app?
For the iOS app, we can verify the elements using Appium inspector. It is an excellent tool to identify the elements’ id, XPath etc. It can also perform to perform user actions.
34) How much time does Appium take to automate a test?
It depends on the scenario you are testing. If you are verifying multiple flows in a single method, it is likely to take more time. But it is always better to make the test cases precise and straightforward so that if any issue occurs in between your execution, you can have the recovery mechanism.
35) When should we use Appium?
Appium supports native, mobile web app and hybrid app. It supports cross-platform testing. If you have running on Android or iOS and want to verify it, you can use Appium.
36) What’s the best approach while Testing is it on real devices or emulators/simulators?
Again, this is depending on your test scenarios, application behaviours. If it is a straightforward application, you can test both on real devices or simulator/emulator. But if your application has complex logic, it is always better to go for real devices. Generally, we should use these to automate because it is ultimately the end-user who is going to use these applications. Real devices also have issues when connecting to the computer for a long time. ADB connections get lost, and it will show devices not attached, which will fail your test cases.
37) How to identify M-Web or Mobile Browser objects using Appium?
UserAgent can be used to identify objects in a M-Web or Mobile Browser. It provides you an way to alter the browser by using mobile proxy to resolve the issue.
Or we can use ChromeCasting for object identification in a Mobile Browser. Using Chromecast, your mobile to the system connection could be established and then you could do inspect elements on mobile from the chrome casting system.
38) What approach to take to identify the unique object in Appium while same class name having multiple objects
driver.findElements(By.className) gives the lists off elements. Once we get the lists, we need to traverse through the indexes to handle the elements uniquely with the same class name.
39) Perform the comparison among Appium and Selenium ?
As we know Selenium is an open-source tool. It helps to automate web application.On the other hand Appium is also an open-source tool. It uses to automate mobile application( Native, Hybrid, Web-apps). Appium implements Selenium Webdriver to interact with the devices.
40) What Data Exchange is when you do testing on Mobile devices?
Data exchange in Appium exchange the data hosted by complex objects which actually are being stored in different components of Web-view based app. One example can be the window object.
41) What are the known limitations of Appium?
Though it has more pros than cons which we’ve already given in the previous question. But there are few things which are worth mentioning as Appium limitations.
The minimum Android version it supports is 4.2. It might not work on the lower versions.
It has little support for testing the hybrid apps. It doesn’t allow the switching from web app mode to native or vice-versa.
If you need multiple sessions, you need to add this support yourself. Appium doesn’t do it by default.
You can’t run appium inspector in Microsoft Windows.
42) What would you prefer to test on real devices or use simulators/emulators?
It’s one of the most commonly asked Appium interview questions. You’ve to be little logical and practical while answering it. Don’t just simply answer “It would depend on what you need.”. Because it would be a layman answer which interview won’t expect from you. Rather you should explain it by example.
You can say something like that it’s always best to test on real devices. As it would allow you to catch errors that you may not detect otherwise. But you have to configure the device smartly with the Appium server so that it can detect the device. Sometimes the ADB, the Android debugger may disconnect from the device even if it remains plugged in. And it can cause your tests to fail. To handle such issues, you can write a module which resets the ADB after some time to re-connect the devices.
43) How do the tests run on simulators/emulators?
The limitation of disconnecting from the devices would never occur with the emulators. They will remain attached to the ADB. You may even set orientation and other hardware-based features that it can emulate.
Running entirely in a virtual world wouldn’t come without some limitations. Your tests would run slow as the emulators consume a lot of memory. Even they might behave intermittently during the execution.
But you can start early testing with them till you acquire the real devices.
44) What are the key design concepts behind Appium?
It’s the server that powers Appium to support cross-platform device testing. And it uses the Webdriver’s JSON wire protocol to run iOS and Android sessions.
Once you have the Appium downloaded and installed, it runs an HTTP server which exposes services via REST APIs.
This server is responsible for processing the commands from the client and executing them on the target platform.
It returns the response in HTTP format which the system handles in an appropriate manner.
It utilizes Apple’s for iOS to control the user interface of the target apps.
For Android devices, it uses Google’s to access API level 16 or higher.
There is to enable access to level 15 or less.
45) Which are the test frameworks that Appium supports?
Appium doesn’t have built-in or default support for any test frameworks.
You can use it with many testing tools like Selenium Webdriver.
There are some unit test frameworks like and <.Net> which you can use with Appium.
Appium provides a driver module that’s what you need for writing test cases.
46) What are the essentials for writing the Appium tests?
There few things that you need before starting to write test cases in Appium.
Driver – It provides a set of APIs to write your Appium tests. It then sends the commands to HTTP server for processing.
Session – All Appium tests needs a session for execution. So, first of all, you have to create it. Close it after the automation ends.
Capabilities – Like you have to set Chrome driver path to start executing tests in a Chrome browser. Similarly, here you need to define params like PlatformName, PlatformVersion, DeviceName and so on.
Commands – These are action words which you use in test steps while you write test cases. Appium has a rich set of commands. Read their syntax and purpose from its online documentation.
47) How would you retrieve a DOM element or the XPath in a mobile app?
Just like the does in Firefox for Selenium, here you have the to locate any element for Android app.
##48) What’s the alternative way to interact with mobile apps while using Appium?
You can use JavaScript to interface with the mobile apps. You can employ the Appium commands to send the script to your app. Just wrap it in a static function and execute.
48) Can you run multithreaded tests in Appium?
Yes, you can. Appium doesn’t prevent you running the tests in a multithreaded environment. Just make sure that no more than one test runs at the same time against the same Appium server.
49) Does it require an <.apk> file for automating tests in Appium?
Yes, you need the <.apk> package to automate using Appium.
50) How to debug failures in Appium test automation?
You have to download the Appium source from GitHub to enable debugging. And then you need to set up a proxy component to add break points.
Related video:
- Packer Tutorials: Amazon Secrets Manager Data Source – amazon-secretsmanager - May 25, 2023
- Packer Tutorials: Amazon Data Sources – amazon-parameterstore - May 25, 2023
- What is DevSecTestOps? - May 25, 2023