Question: What Is Appium?
Appium is a freely distributed open source mobile application UI testing framework.
Question: 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).
Question: 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.
Question: 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.
Question: 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
Question: 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.
Question: 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.
Question: 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.
Question: How Can I Run Android Tests Without Appium?
For 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.
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”. In 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 test Mobile 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”).
Question: How Can I Run Ios Tests Without Appium?
For 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.
Question: How Can I Run Manual Tests For My Mobile Native App Or Mobile Hybrid App?
Sauce Labs doesn’t support manual tests for mobile native app or mobile hybrid app tests.
Question: 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.
Question: 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.
Question: 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.
Question: I Don’t Want To Set Up A Whole Infrastructure For My Tests And I Don’t Want To Spend Money On Hw. 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.
Question: I Need To Debug Appium, Is It Difficult?
Question: 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.
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.
Question: Is It Returning The Values?
Question: 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.
Question: 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.
Question: List Out The Pre-requisite To Use Appium?
Pre-requisite to use APPIUM is:
- ANDROID SDK
- Selenium Server JAR
- Webdriver Language Binding Library
- APPIUM for Windows
- APK App Info On Google Play
Question: 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.
Question: 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).
Question: 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.
Question: 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.
Question: 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.
- 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.
Question: 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.
Question: 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.
Question: 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
Question: What Language Does Appium Support?
Question: 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.
Question: What Platforms Are Supported?
Appium currently supports Android and iOS, no support for Windows unfortunately.
Question: 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!
Question: What Type Of Keyboard And Buttons Do The Android Emulators Have?
Android Emulators have software buttons and a hardware keyboard. In a regular Android emulator the device buttons are software buttons displayed on the right size of the emulator. For the Android emulators with different skins (e.g Google Nexus 7 HD, LG Nexus 4, Samsung Galaxy Nexus, Samsung Galaxy S3, etc) the device buttons are also software buttons that are overplayed on top of the skin. For instance, if you hover the mouse around the edges of any of our Android emulators with an specified skin, a hover icon will appear and you should be able to find whatever buttons actually exist on the device that the skinned emulator is trying to emulate (e.g power button along the top, volume buttons along the edge, back/home buttons right below the screen, etc).
Question: 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!
Question: 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!
Question: 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.
Appium Questions and Answers for Interview
Preparing for Appium job interview and whether you’re experienced or fresher & don’t know what kind of questions will be asked in Appium interview, then go through the above 70+ Top Appium Interview Questions and Answers to crack your job interview.