Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

What are Test Scenarios in Software Testing?

In simple words, test scenarios define as a set of functionality of any application or website that
can be tested either manually or with automation. The test scenarios are very helpful for the
testing team, It helps to determine the positive and negative characteristics of the application or
website. With the help of an effective test Scenario, the testing team will get a clear idea about
what we need to test.

What Are The Tools Used For Mobile Automation Testing?

• Appium.
• Robot Framework.
• TestComplete.
• Robitium.
• Monkey Runner.
• Testingbot.
• Experitest.

Also Read: What are the mobile testing tools?


Tips: How Do you Write Test Scenarios for a Mobile Application?

Writing test scenarios for mobile applications is one of the challenging parts of app testing.
But,scenario-based testing is one of the easy ways to test complicated Systems. So keep in mind
the below tips while preparing mobile application testing scenarios.

1. Try to create a simple test scenario.


2. Avoid to design complicated test scenarios, Try to make it short and simple to be easily
understood.
3. Focus on project methodology.
4. Focused on customer priorities and try to run test scenarios accordingly.
5. Pay Attention to the expected result.

What is the Difference Between Test Cases and Test Scenarios?

Test Cases - Test Cases include only small steps which are helpful to execute the expected result. It is the process to
validate the Test Scenario, It is the low-level concept of software testing means how to do testing.

Test Scenario - A Test Scenario includes a detailed document of the testing procedure, It is the process to test the
complete functionality of the application. It is the top-level concept of software testing means what things need to test.
The Top 25 Mobile Application Testing Scenarios :

• Ensure the app has been launched by downloading and installing it for use.
• Verify that the mobile app display is adaptable to the device screen and also ensures all menus on
the app are functioning.
• Verify that the text on the mobile app is readable and clear.
• Check that the app display is adaptable and amenable to the various display mode (i.e. landscape
and portrait).
• Verify that the app does not stop the functioning of other apps on the mobile device.
• Verify that in the play screen, the back key allows the app to go back to the start-up screen.
• Check that the app still operates as intended, if the device resumes from inactive mode or the lock
screen.
• Check whether the app reminds the user to save setting changes or changing of information before
moving to other activities on the app.
• Verify that the on-screen keyboard appears immediately the user attempt to enter a text.
• Check if the app behaves as designed if the mobile device is shaken.
• Verify that the app still functions as designed when “battery low” notifications appear on the
screen.
• Check that the app goes into the background when on call.
• Check that the app still operates as designed when a message or notification pop-up from another
app such as Facebook messaged, Instagram, etc.
• If the app comes with a users’ settings features, check if the app changes when some form of
change is affected by the user.
• Check the Performance of the app on the different internet networks such as 1G, 2G, 3G, or 4 G
networks.
• Check that the app operates as intended when the device is connected to the internet through
WiFi.
• Check that the app still operates normally when there is an incoming call or SMS.
• Check that the app is adaptable to different mobile platforms or OS such as Android, iOS,
Microsoft, etc.
• Check that the font size and style of the app are compatible and readable to the users.
• Verify that that the loading time for the app is not too long.
• Check that the app is still working as intended after the successful update of the app.
• Check how the app function under different battery levels and temperatures.
• Verify that the app is not draining too much battery.
• Check that the app support image capturing.
• Check that the app does not log out the user before the end of a session.

Simple Example of Test Scenarios To Validate the Login Form of Web Page

Test Case 1: Enter Mail ID

Test Case 2: Enter User Name

Test Case 3: Enter Password


Test Case 4: Enter Wrong Password

Test Case 5: Enter Correct Password


Conclusion

As a result, mobile app testing turns out to be more challenging so try to design more effective mobile testing scenarios. If you have any
queries related to app testing or want to know more about our mobile application testing services, connect with our QA experts for your
project.

1) What is Appium? Why is it used?

Appium is an open-source, freely distributed mobile application UI Testing framework or automation mobile
testing tool used to test mobile applications. It is developed and supported by Sauce Labs to automate native
and hybrid mobile apps. Appium is a cross-platform mobile automation tool. It means you can run the same
test on multiple platforms. You can also quickly test multiple devices parallel by using Appium.

2) What are the crucial features of Appium?

Following is the list of crucial features of Appium:

o There is a strong and active community available for Appium.


o Appium does not require application source code or library.
o It is open-source, freely distributed, and cross-platform support.
o Due to its multi-platform support, you can run the same test cases on multiple platforms.
o Appium allows the parallel execution of test scripts.
o Appium is time-efficient because a small change does not require re-installation of the application.
o Appium supports various languages like Java, Python, C#, Ruby, PHP, JavaScript with Node.js, and many others
that have Selenium client library.
o It supports JSON wire protocol.
o It does not require recompilation of App.
o Appium has no dependency on mobile devices.

3) What are the similarities between Appium and Selenium Webdriver?

There are a lot of similarities between Appium and Selenium Webdriver testing tools. So, if you already know
Selenium Webdriver, you can quickly learn Appium.

Appium doesn't have any dependency on mobile devices OS because its framework converts the Selenium
Webdriver commands to UIAutomator, and UIAutomation commands for Android and iOS, respectively,
according to the device type rather than the OS type.
4) What are the advantages and disadvantages of Appium?

Following are the list of advantages and disadvantages of Appium:

Advantages of Appium

o Appium is an open-source tool, which means it is freely available. So, we don't have to pay for installing it.
o If you are aware of Selenium Webdriver, you can quickly learn Appium because there are many similarities
between them. So, it is easy to install.
o It allows the automated testing of hybrid, native, and web applications.
o Appium is fully compatible with automation. We don't need to include any additional agents in our App like
other testing tools to make it compatible with automation. It tests the same App, which is going to upload to
App Store.
o Along with the mobile application testing, it would also support desktop application testing for windows.
o This is a cross-platform, freely available mobile testing tool. We can test it on multiple platforms (single API
for both Android and IOS platforms).

Disadvantages of Appium

Appium has some great features and advantages, but it has some drawbacks too, which are as follows:

o It doesn't provide detailed reports.


o It uses the remote web driver for testing, so it is a bit slow.
o It is not a limitation, but an overhead that Appium uses UIAutomator for Android supports Android SDK, API
16, or higher. However, Appium supports older APIs, but not directly. It uses another open-source library
Selendroid to support older APIs.
o In iOS, it supports only one instance (iOS Script) to run on one Mac OS device. It means one test can be
executed at a time per Mac. If you want to run your tests on multiple iOS devices simultaneously, you need to
arrange the same number of Mac machines. But it would be costly to set various Mac machines.

5) Which types of applications can be tested using Appium?

Appium can test all types of applications, i.e., native, hybrid, and web. Let's see them in detail:

Native Applications: The native applications are software programs that are developed using a specific
software development kit. Native apps are designed for use on a particular device and installed from the App
Store, such as Google Play Store or Apple's App Store. These applications can work offline and can also use
the device notification system.

Examples of native applications are Pinterest, Skype, Snapchat, etc.

Web Applications: Web applications are websites that run on browsers. These applications are developed
using HTML, CSS, and JavaScript, unlike Android and iOS apps. They do not require a Software Development
Kit (SDK) for developers to work with. Web applications run on web browsers so, they don't need any
installation.

Examples of some web applications are Flipkart, Facebook, Twitter, etc.

Hybrid Applications: Hybrid applications are a combination of native and web applications. Like native
applications, you can download them from the App Store, but actually, they are web applications inside. These
applications are developed using web development languages such as HTML, CSS, JavaScript, etc., which
allows them to run on any platform.

Examples of some hybrid applications are OLA, Instagram, Basecamp, etc.

6) What are the main prerequisites to use Appium?

You must have the following things on your system to use Appium. You must have installed the following
software:

o Java (JDK) on your system.


o Android Studio
o js
o Additional Android SDK tools
o Appium jar file
o Appium Desktop Client
o Eclipse IDE for Java
o TestNG
o Eclipse
o Selenium Server JAR
o Webdriver Language Binding Library
o APPIUM for Windows
o APK App Info On Google Play
o js

Note: The js by default comes with "node.js" and "NPM" whenever you install the Appium server. So,
you don't need to install node.js and NPM separately. It is already included in the current version of
Appium.

7) Explain the working principle of Appium as how it works on your system.

Appium is an "HTTP Server" written using Node.js platform and drives iOS and Android sessions using
Webdriver JSON wire protocol. So, before initializing the Appium Server, you must have preinstalled Node.js
on your system.
When we download and install Appium on our system, it installs a server and it on the machine that exposes
the REST API. When the clients send the command and connection requests, it executes that command on
devices like iOS or Android and replies with the HTTP responses. To execute the requests, it uses a mobile test
automation framework to run the app's user interface.

For Example, it uses Apple instruments for iOS, Selendroid for Android API 15 or lesser version, and Google
UIAutomator for Android API 16 or higher versions.

Note: Appium uses the open-source library Selendroid to support older APIs because UIAutomator
only supports API 16 or higher.

8) What do you understand by Appium Inspector?

Appium Inspector is similar to Selenium IDE record and Playback tool. It is also is used for record and playback
tasks. It is used to record and play the native application behavior by inspecting DOM and generate the test
scripts in any desired language.

Appium Inspector does not support Windows and uses UIAutomator viewer as its option.

9) What is the difference between Appium and Selendroid?

10) What are the basic requirements for writing Appium tests?

We need the following things for writing Appium tests:

o Driver Client: Appium drives mobile applications such as a user. It needs a Driver Client library to write your
Appium tests, which wraps test steps and sends them to the Appium server over HTTP.
o Appium Session: We have first to initialize a session so that the Appium test can take place in the session.
Once the Automation is done for one session, it can be ended and wait for another session.
o Desired Capabilities: Desired Capabilities are certain parameters such as PlatformName, PlatformVersion,
and Device Name, etc., which are required to initialize an Appium session. It specifies the kind of automation
one requires from the Appium server.
o Driver Commands: Driver Commands are used to write test steps using a large and expressive vocabulary of
commands.

11) What is the difference between Appium and Robotium?

12) What are some possible errors that a developer can face while using Appium?

Following is the list of some possible errors a developer can face using Appium:
o Error 1: The following desired capabilities are needed but not provided: Device Name, platformName
o Error 2: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root
directory path.
o Error 3:selenium.SessionNotCreatedException: A new session could not be created
o Error 4: How to find DOM element or XPath in a mobile application?

13) What are the main types of mobile app testing?

Following is the list of some types of mobile app testing:

o Usability testing
o Compatibility testing
o Performance testing
o Interface testing
o Services testing
o Low-level resource testing
o Operational testing
o Installation testing
o Security testing etc.

14) What is Mobile Application Testing (MAT), and how is it different from Mobile Testing (MT)?

Mobile Application Testing is the testing of an application on mobile devices. It is entirely different from
Mobile Testing. In Mobile Testing, the main focus is on the native application features of Mobile devices such
as Calls, SMS, Media Player, etc. On the other hand, in Mobile Application Testing, the main focus is only on
the application's functionality and features we want to test.

15) What is the most challenging scenario to test with Appium?

The data exchange is the most challenging scenario to test with Appium.

16) What is the difference between simulator and emulator?

A simulator creates an environment that mimics the behavior and configurations of an actual device. On the
other hand, an emulator is used to duplicate all the device's hardware and software features. Emulation and
simulation processes are both used in mobile app testing in addition to real devices.
17) Is a server machine required to run tests on Appium?

No. There is no need for a server machine to run tests on Appium. Appium provides a 2-tier architecture where
a test machine connects to a test server running Appium and automating the whole thing. We can run Appium
on the same machine where we run our test.

18) What is the general structure of mobile application testing frameworks?

There are mainly three segments used in Mobile Application Testing frameworks:

o Application Package: the Application Package is the target application that we have to test.
o Instrumentation TestRunner: The Instrumentation TestRunner can be defined as a test case runner that runs
test cases on the target application. It consists of an SDK tool for building tests and a tool that provides APIs
for writing a program that controls an Android device, for example, MonkeyRunner.
o Test Package: The Test Package contains two classes, Test case classes and Mock objects. The Test case
classes include test methods to perform on the target application, while the mock object has mock data that
will be used as sample input for test cases.

19) Is it possible to interact with apps using JavaScript while testing with Appium?

Yes. We can easily interact with Apps while using JavaScript. When we run the commands on Appium, the
server sends the script to our app wrapped into an anonymous function to be executed.

20) What is the full form of iPA, APK, .exe, jad, and prc?

The full form of these terms is as follows:

o iPA: iOS APP Store Package


o APK: Android Application Package file
o .exe: Executable File
o jad: Java Application Descriptor
o prc: Palm Resource Compiler

21) What are the desired capabilities in testing?

The desired capabilities are keys and values such as a map or hash sent by the client to the server. The client
sends these to tell the server what kind of automation session they want.
22) Can a tester run the tests in a multithreaded environment while using Appium?

Yes, testers can run the tests in a multithreaded environment while using Appium. The only thing that they
have to care about is to ensure that no more than one test runs at the same time against the same Appium
server.

23) How can you inspect elements of the Native Android App?

It is easy to inspect the elements of the Native Android App using the UIAutomator tool in Android SDK. You
can also get access to the object locators of the Android Native Apps.

24) What do you understand by Appium package master? How would you create a package?

Appium package master is a set of tools used to manage and create Appium packages. We can use the
following code to create a package:

# using es7/babe1:

Gulp create-package -n <package-name>

#regular es5:

Gulp create-package ---nobabe1 -n <package-name>

The package will be generated in the out/<package-name>

25) What are some critical issues you faced with cross-platform testing?

Generally, cross-platform testing is compatible with multiple platforms, but one can face cross-platform
testing issues. The issues depend upon the different OS/device versions. You can see that the same application
works on one OS while it might not work on another version.

For example, we have faced an issue that our application was working fine on iOS 6.x version devices but on
tapping a few modules on iOS 5.x devices, the application crashes. The same thing happened with 2.3.5 Vs.

26) What do you need to automate using Appium in Android? An app's .apk or you also need the app in my
workspace?

In Android, we only need a .apk file to automate using Appium.

27) Does Appium support test frameworks?


Appium does not support test frameworks because there is no need to keep them. We can use Appium with
any frameworks that we want.

28) What is the difference between Appium and Calabash?

29) What do you understand by native Apps?

Those Apps which are written by using Android SDKs and iOS are known as Native Apps.

30) What do you understand by Mobile Web Apps?

The mobile web pages that can be accessed with mobile browsers are known as Mobile Web Apps. In the case
of the iOS platform, Appium supports the Safari browser, and for the Android platform, it uses Chrome or any
other built-in browser.

31) What do you understand by hybrid apps?

The apps equipped with a wrapper around the web view are known as Hybrid apps.

32) How much time is required to write a test in Appium?

The time to write a test in Appium depends on the test. If your test runs a scenario, it will take as many
commands as the number of interactions needed to be performed (thus very few lines), then it will take less
time. If you are trying to exchange data, your test will take more time for sure, and the test will also become
challenging to read.

33) How is the data exchanged between your test and the app while testing the app?

In Appium, the Web driver doesn't require to exchange data with the app. But it is not impossible to exchange
data. You can quickly achieve this by building more layers of testability.

34) Is debugging a problematic task in Appium?

No, debugging is not much tricky in Appium. Appium is a Node.js application; thus, the code is written in
JavaScript. You can find the code on GitHub and downloaded it in a few seconds as it is small and not so
complex. The complexity also depends on what you have to debug.
35) How can you inspect elements on the iOS apps?

We can quickly inspect elements on the iOS apps by using an Appium inspector. It is a GUI-based tool used
to identify elements on iOS apps. This is quite similar to that of selenium IDE.

2. What are native Apps?

Ans: 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?

Ans: 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?

Ans: Those apps that are equipped with a wrapper around the web view are known as 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?

Ans:

• The tests of Appium are written in 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 the Selenium protocol.
• The most sought-after development frameworks are .Net, C#, Java, Python, JavaScript, and Ruby.

6. What are the prerequisites to use Appium?

Ans: The pre-requisites that are used in Appium. They are listed below.

1. Eclipse IDE
2. Android SDK
3. TestNG
4. Web driver language binding library
5. JS
6. JDK
7. APK App Info on Google play
8. Selenium server jar
9. Appium for Windows

Related Article: Difference b/w Appium Vs Selenium Vs Calabash

7. Write the advantages of using Appium?

Ans: 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?

Ans: 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 the .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. What are the disadvantages of Appium?

Ans: 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 Appium inspector?

Ans: Just like a selenium IDE playback and record tool, Appium consists of an inspector that is used to
record and playback. With the help of this, you can record and play native application behavior which
is achieved by inspecting DOM. It helps in generating the test scripts in any language that is preferred.
But Appium Inspector is not good support Windows and they use UIAutomator viewer in the option.

12. Suppose you are testing App, how will the data be exchanged between your test and the App?

Ans: In Appium the Web driver specification is not made for the purpose of exchanging data with the app.
But it is not totally impossible to exchange data. It is achievable and it will require you to build more
layers of testability.

13. Explain the design of the Appium?

Ans: Appium is considered as an HTTP server that is written using the Node.js platform. It runs on both
android and IOS sessions with the help of web driver JSON wire protocol. After the download and
installation of the Appium are completed the server is then set up on the machine which exposes a
REST API.

Then the Appium also receives connections and command requests from clients. These commands are
then executed on mobile devices. Generally, appium respond backs with an HTTP response. To execute
the request, Appium uses mobile test automation frameworks so that it can drive the user interface of
the apps. Some of the mobile automation frameworks are

1. Google UIAutomator for Android API of level 16 or more than that


2. Apple instruments for the IOS platform
3. For android API level 15 or lesser than that, Selendroid is used.

14. How can you find the DOM element or X path in the case of a mobile application?

Ans: In order to find the path between DOM elements or X path elements, you can make use of
"UIAutomateviewer" in the case of the Android application.

15. What are the pros and cons of Appium?

Ans:

Pros- Irrespective of the platform, the programmer will be able to automate all the complexities which
remain under a single Appium server. Also, Appium helps in providing cross-platform mobile testing
which signifies that the same test pattern will work on multiple platforms.
With the help of Appium, there will be no need for extra components in the app to make it more
users friendly. Appium can also automate hybrid, web, and native mobile applications.

Cons - It is not possible to run scripts on multiple IOS simulators simultaneously. With the help of Appium,
you are able to use UI Automator in the case of Android automation which only supports the Android
SDK platform and those API which is 16 more than that. For using an older version of APIs you will have
to use another open-source library which is known as Selendroid.

Appium Interview Questions and Answers for Experienced

16. Name the types of errors that you can face in Appium?

Ans:

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?

Ans: 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
that is running on Appium and also automating the whole thing. Appium can be run on the same machine
where you are running the tests.

18. Do you think it is possible to interact with the apps by using javascript while you are testing
the Appium?

Ans: While you are testing the Appium it is possible for you to interact with the apps using Javascript.
During the time when the commands are being run on Appium, the server will then send the script to the
app that is wrapped in an anonymous function that is to be executed.

19. What are the most difficult scenarios that one might face while testing Appium?

Ans: 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?

Ans: 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. In the case of the Android platform is it necessary to have an app’s .apk so that it can automate
using Appium or do we also need an app in the workspace?

Ans: In the case of the android platform, to automate using Appium you will require only a .apk file.

22. What is an Appium package master? How can you create an Appium Package?

Ans: A set of tools that are required to create and manage appium packages are defined as Appium
Package master. In order to create a package using the following code:-

#using es7/babe1

Gulp create-package –n

#regular es5

Gulp create-package ---nobabe1 –n

The package will be created in the out/

23. What is the underlying API that Appium follows?

Ans: 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.

24. How can you inspect elements that are present in the Native Android App?

Ans: With the help of the UI Automator tool that is present in Android SDK, you will be able to access
those object locators that are part of the Android Native app.

25. Mention the method with which you can scroll down in App?

Ans: 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.

26. Is it possible to start an Appium server programmatically?

Ans: 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.

27. How can you inspect elements on the IOS apps?

Ans: With the help of using an 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.
28. How is it possible to identify Mobile browser objects?

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

29. Write the command that will allow you to identify objects uniquely when there are multiple
objects within the same class name using Appium?

Ans: With the help of the command driver. find element (By.className) it is possible to identify the
elements uniquely.

30. Give the difference between emulator and simulator?

Ans: 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.

31. Do I need Appium?

Ans: 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 the
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 web view-based app (necessarily) targeting
many platforms out there.

32. How difficult is it to set up a working environment?

Ans: The assumption is that Appium comes with 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)

33. Can Appium be used for all my tests?

Ans: 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 platformed
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! The world is
not black and white!

34. What is Appium’s most considerable limitation?

Ans: Hand down my chin starting to think 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.

35. How active is Appium?

Ans: 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 from my personal experience). The community around Appium is also
pretty large and growing every month.

36. Which approach is the best? Testing on real devices or simulators/emulators?

Ans: 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 the 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 in 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 that resets ADB after some time so that devices will not disconnect.

37. Tests on emulators or simulators?

Ans: On the other hand, emulators/simulators will never disconnect from Appium. They also offer nice
options like the ability to choose 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.
38. I already have platform-specific tests for my app, what should I do to migrate to Appium?

Ans: 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 be told, you will probably need to write your
tests from the beginning, what you can do is actually reusing your existing components.

39. How much time does it take to write a test in Appium?

Ans: Of course, it depends on 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.

40. Any tips or tricks to speed up my test writing activity or my migration process?

Ans: Here is one piece of advice. Since your tests will mostly consist of 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 into
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).

41. What test frameworks are supported by Appium?

Ans: Appium does not support test frameworks because there is no need to support them! You can use
Appium with all the 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!

42. Is it possible to interact using Javascript with my apps, while the appium testing running?

Ans: 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 it into an anonymous function
that has to be executed.

43. Is it Returning the values?

Ans: However, your Javascript interaction can get more advanced as your script can return a value that
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.

44. How can I exchange data between my test and the app I am testing?

Ans: 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 is 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.

45. What data exchange is?

Ans: 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 review-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.

46. What are Testability layers?

Ans: 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.

47. Is it Exchanging data through Javascript?

Ans: Selenium provides commands to 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 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.

48. What are the most difficult scenarios to test with Appium?

Ans: 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, then just throw Appium away).

Appium is very nice because it will let you write tests once for all platforms instead of writing as many
tests as the number 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.

49. 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?

Ans: 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.

50. I need to debug Appium, is it difficult?

Ans: Not 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 a 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 were 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), which will be hit every time commands are sent to platform-specific
components to be translated into automation commands.

51. I build my apps with CORDOVA, is it supported by Appium?

Ans:

• CORDOVA is a very famous system that enables you to develop web view-based apps for all platforms in
a 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 acknowledgment 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).

52. What are the basic commands that I can use in the SELENIUM protocol?

Ans:
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 web view-based app’s pages by using their ids or class names.
• Raise events on located elements like Click().
• Type inside text boxes.
• 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 web view. If your app uses more
web views, you can switch the context to the web view you desire. If your web view has frames or
iframes inside, you
• can change the context to one of them
• Detect alert boxes and dismiss or accept them. Be careful about this functionality, I experienced some
problems.

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

Ans: 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.

54. How can I run Android tests without Appium?

Ans:

• 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”).

55. How can I run iOS tests without Appium?

Ans:
• 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.

56. What mobile web browsers can I automate in the Android emulator?

Ans: 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.

Q #1) Describe various types of mobile applications


Answer: Mobile applications are of the following three types:
• Native Applications: Applications that are created with the help of iOS and Android SDK are Native
Applications. Native applications developed in Android will not work on iOS phones and will not be available on
iOS App Stores. Native applications designed and optimized for specific platforms offer the best performance,
UI/UX suitable to run on that platform, Google Play Store support, offline mode, consistent look and feel, security
and data protection, and fewer bugs during development. Some examples of Native applications are the mobile
version of WhatsApp, Amazon Prime, Linked In, etc.
• Mobile Web Applications are actual websites developed in HTML5, accessible by browser, can be accessed
offline because of the browser cache. Some examples of mobile web applications are Newspaper as ePaper,
Google applications like Drive, Gmail, Docs, Sheets, Forms, and Photos, etc.
• Hybrid Applications are a mix of native and web applications, like native applications are available on the mobile
app stores, and have features similar to native applications, like web applications rely on web browsers to be
rendered. Online eCommerce sites and Netflix are some of the best examples of hybrid applications.
Native, Mobile, and Hybrid Mobile Application:

Q #2) What is the difference between iOS and Android?


Answer: Both iOS and Android are used as operating systems for mobile devices. Their differences are listed
below:
iOS Android
iOS is mobile operating system developed by Apple for to Android
run all is mobile operating system developed by Google
applications on iphone mobiles. LLC for mobiles that run on Android.
It has Hybrid type kernel. It has Linux based kernel type.
Developed using objective C and swift language. Developed using Java and Kotlin language.
The default Internet browser used in iOS based devices isAndroid
Safari. devices has Google chrome browser but allow use
of any internet browser.
iOS has Siri as Voice Assistant. Android has Google Assistance.
iOS devices can block installation of 3rd party applications
Androidon does not block 3rd party applications.
them.
Q #3) What hardware and software are the prerequisites for using Appium?
Answer: The list of software required before installing Appium is as below:
Hardware requirement:
• 8 GB RAM Memory
• Windows 10
• .Net Framework 3.5 or higher.
Software requirement:
• Java Development Kit (JDK) – It should have at least JDK version 8 or higher.
• Android SDK version 22 has separate platforms and build tools, suitable for Appium.
• Node.js is needed for a non-blocking event-based server to handle multiple WebDriver sessions for iOS and
Android platforms.
• Microsoft WebDriver- also known as WinAppDriver, Appium compatible WebDriver server – Need Windows 10
or above.
• PDANet+ – It is a free application that converts Android and iOS mobile into Modem and enables tethering.
• Appium – Client libraries and Desktop application of Appium is mandatory
• GenyMotion – It is required to run Appium tests in multiple virtual Android devices in parallel.
• ADT Plugin to access Android SDK within Eclipse.
• Java Client Drivers are also known as language binding for creating testing in multiple programming languages.
• Appium Client Libraries supports Appium extensions to WebDriver protocol by Appium Server.
Q #4) List advantages of using Appium.
Answer: It offers the following advantages:
• It is open-source, supports both iOS and Android
• We can design an automation script using the same API for Android and iOS.
• Supports multiple languages like Java, Node.js, Ruby, Python, Robot framework and is cross-platform.
• Can be integrated with continuous integration tools.
• Issues like synchronization are avoided.
• Uses HTTP protocol and is based on Selenium
Q #5) List limitations of using Appium
Answer: Following are some limitations:
• The time needed, and configuration for Appium set up is complex
• It can run a single iOS device at a time.
• There is no support for automation for Android 4.1 or lower.
• There is no support for Windows for Appium inspector.
• Limited support for testing hybrid applications.
• You cannot test the switching action of native to the web or vice versa.
Q #6) Explain the working of Appium
Answer: The working of Appium is explained below:
1. Appium server developed using Node.js implements selenium WebDriver.
2. The connection request is sent by WebDriver script to Appium server via JSON Wire protocol.
3. Automation session and desired capabilities are set
• In case of Android, the request is sent to UIAutomator, UIAutomator communicates with bootstrap.jar running on
an Android mobile device or emulator to perform operations.
• Whereas for iOS, UIAutomation receives requests. UIAutomation communicates with bootstrap.js running on iOS
mobile devices or emulators to perform operations.
4. After execution of the request sent, the message is sent back to the Appium server. The results of
execution are captured by server logs.
Working of Appium:
Q #7) Describe the JSON wire protocol used in Appium.
Answer: JSON wire protocol uses RESTful API to communicate between Appium client and server, controls
behaviors of mobile phone in addition to setting communication stream.
Q #8) List locators used in Appium
Answer: List of locators support is as below:
• ID
• Class Name
• XPath
• Accessibility ID
• Android UI Automator
• iOS UI Automation
• Android View Tag using Appium Espresso

Q #9) List difference between Selenium WebDriver and Appium WebDriver


Answer: Selenium and Appium both use
• JSON wire protocol
• Methods like
• sendKeys(),
• findByClassName(),
• findByElementId(),
• findByXPath()
There is a difference between Selenium WebDriver and Appium WebDriver as below.

Q #10) What is selendroid?


Answer: Selendroid is a mobile automation tool for Android-based applications that uses selenium WebDriver
client API. It uses inspector for monitoring the current UI status.

Q #11) List the activities possible with the real device but not with the emulator.
Answer: The list of functionalities that are not possible with an emulator is as below:
• Make or Receive Calls, Send or Receive SMS,
• Battery issues, GPS tracking, Gesture recognition, touch screen functionality
• Changing Color over the screen, widgets, accessing the file
• Selecting icons to access the application with help of fingers (touch screen),
• Typing the text, moving the mouse on a real mobile screen will differ from that of an emulator.
• Performance tracking of the installed mobile application, etc.

Q #12) What is Espresso?


Answer: Espresso is a test automation framework for Android. It is a UI automation framework suitable for black-
box testing that uses JUnit4 annotations. The tests in Espresso are written using Java and Kotlin. Appium uses
Espresso with Android View Tag.

Q #13) What is XCUITest?


Answer: XCUITest is an automation framework for iOS. This framework is used to test only native mobile
applications that are built using swift or objectives C. XUITest cannot write tests for multiple platforms. Appium
uses the XCUITest driver for automating iOS applications.

Q #14) List some common exceptions in Appium observed during test automation?
Answer: Following are some commonly encountered exceptions in Appium during script execution:
• SessionNotFoundException: On disconnection of Appium connection or Session not established, display this
exception
• ElementNotFoundException: When Appium does not find the element it is looking for, this exception is
displayed
• WebDriverException: When Driver does not exist, this exception is displayed
• NoSuchContextException: is thrown when the context target that is to be switched to does not exist.

Q # 15) List the differences between the working of Appium on Android and iOS.
Answer: Appium executes tests differently on Android and iOS-based mobile.
• Appium uses the UIAutomator framework of automation when tests Android-based mobile applications.
• Appium on the iOS mobile device uses Apple’s XCUI Test API to interact with UI elements to test their
functionality.
• UIAutomator connects with bootstrap.jar being executed in simulator/emulator or real device that performs client
operations.
• XCUI Test in case of iOS mobiles communicates with bootstrap.jar
• Bootstrap.jar acts as a TCP server that accepts test commands to test the functionality of Android-based mobile
that uses UIAutomator.
• Bootstrap.jar performs the action on the iOS mobile application being tested, Appium Client sends a message with
log details of commands executed.
Q #16) List the essentials you need to write the Appium test?
Answer: The essential things required are:
• Driver – Set of APIs help write tests and commands are sent to HTTP Server for processing,
• Session – Session instances should be created during execution of automation testing and closed after execution,
• Capabilities – Set up of Chrome Driver path to execute tests in Chrome browser and defining params like
PlatformName, PlatformVersion, and DeviceName,
• Commands – Appium requires commands that are action words that perform test steps.

Q #17) Describe desired capabilities in Appium


Answer: Desired capabilities are keys and values inside JSON objects sent by Appium client to server to perform
all the actions required to test the functionality.

Q #18) What are the properties present in key-value pair in desired capabilities?
Answer: Few of the properties are explained that are present in keys and values form in desired capabilities as
below:
• automationName: Provides name of the automation engine that will be used. Appium is used by default, and
Espresso, UIAutomator1 & 2 for Android, whereas XCUITest for iOS.
• platformName: Name of mobile OS platform being used, for example, iOS, Android or FirefoxOS
• platformVersion: Version of mobile OS such as 7.1, 4.4, etc.
• deviceName: Mobile device or emulator type – iPhone Simulator, Android Emulator, etc.

Q #19) List design considerations in Appium


Answer: Following are some points taken into consideration in Appium Design:
• Node.js should be installed already on the system as Appium Server is actually a HTTP server designed using
Node.js that drives iOS and Android sessions with help of WebDriver JSON wire protocol.
• Appium server installed on system acts as REST API.
• Appium server receives connection and command requests whereas command executes on iOS/Android devices.
• Appium server sends HTTP responses to interact with the user interface using the mobile test automation
framework.
• There are various frameworks for
• iOS mobile devices
• Google UI Automator for Android API level 16 or higher
• Selendroid for Android API level 15 or higher

Q #20) Explain implicit and explicit wait in Appium


Answer: Appium Web Driver checks the web element or certain conditions with the help of locators, various waits
are applied during the execution of automation script are explained below:
Implicit Wait: Web Driver will make automation script wait for a certain time period in search of web element.
After this time, If the element does not display, the error “No such Element found Exception” will be thrown.
Syntax:
driver. manage(). timeouts(). implicitlyWait (TimeOut, TimeUnit.SECONDS);
Explicit Wait: The Web Driver will wait for certain condition OR will throw “ElementNotVisibleException”
exception after maximum time for wait exceeds,
Some of the conditions for explicit wait are:
• alertIsPresent(),
• elementToBeClickable()
• presenceOfAllElementsLocatedBy()
• textToBePresentInElement()
• visibilityOf()
Syntax:
WebDriverWait wait = new WebDriverWait(driver, 15);

wait.until(ExpectedConditions.textToBePresentInElement(By.xpath("xpath"), "Text"));

Q #21) List common pitfalls you should avoid while writing Appium tests.
Answer: While writing Appium tests following points should be taken into consideration:
• Avoid excessive use of XPath as a locator.
• Use accessibility ID locator for both iOS and Android mobile device testing.
• Querying for visibility of elements should only be restricted for important elements.

Q #22) What is the purpose of Appium Inspector?


Answer: Appium Inspector is a utility provided by the Appium automation framework that helps to load mobile
applications and locate elements.

Q #23) Describe ways to debug Appium tests.


Answer: Following are some ways we can do:
• Any error that occurred during mobile tests can be traced from the logs generated at the Appium server.
• Test scripts created can be debugged with the help of the programming language used in writing these tests.

Q #24) How can we retrieve the test status of Appium test execution?
Answer: There are various ways to display the test status:
• Integrating TestNG with Appium
• ExtentReports that give test status reports in the dashboard
• REST API of BrowserStack App Automate for .apk (Android app) or .ipa (iOS app).
• Built-in reporting tools like Maven and Allure

Q #25) What is Calabash?


Answer: Calabash is a mobile test automation framework for testing mobile devices based on iOS and Android
platforms, tests written using Cucumber, Gherkin, and Ruby code.

You might also like