1. Can mobile gestures be automated using Appium?

Answer: Yes, Mobile gestures can be automated using Appium. Using TouchActions api, mobile gestures can be automated. TouchActions is similar to Actions class in Selenium. In addition, JSON wire protocol extensions are also enabled in TouchActions. Gestures like tap, flick, swipe, scroll, shake can be automated using Appium.

2. What is the default port number used for Appium Server?

Answer: Default port number used for Appium Server is 4723. You need to mention the same while writing desired capabilities in the initial lines of code.

3. What is appPackage and appActivity name?

In very basic terms, appPackage is the technical name of the app which is provided by its developers. It’s actually a top level package under which all the code for the app resides.
For example, appPackage for ‘YouTube’ for Android is ‘com.google.android.youtube’. For Facebook, this name is ‘com.facebook.katana’ and for WhatsApp, the appPackage is – ‘com.whatsapp’. So if you want to launch Facebook from Appium, you would need to provide it’s name as ‘com.facebook.katana’ in Appium.
appActivity refers to the different functionalities that are provided by the app.
For example, WhatsApp provides multiple functionalities such as conversations, profile information, setting profile photo, setting status, notifications and a lot of other things. All these functionalities are represented by different appActivity. Together with these activities, every app has a main activity which is sort of the main screen you see when you launch the app.

4. How to identify the appPackage and appActivity name for any Android app?

Method 1: Using ‘mCurrentFocus’ or ‘mFocusedApp’ in Command Prompt

Step 1: Run ‘adb devices’ command to just make sure that your mobile is properly connected.
Step 2: Run ‘adb shell’ command to change the prompt.
Step 3: Now in your mobile phone, open the app for which you want to find the appPackage and appActivity.
Step 4: Now run this command: dumpsys window windows | grep -E ‘mCurrentFocus’
Step 5: The above command would display the details of the app which is currently in focus. From that, you can figure out the appPackage and appActivity name.

appPackage starts with com. and ends before backshash (/).
appActivity starts after the backslash (/) and goes till the end.

Step 6: There is one more similar command that provides the appPackage and appActivity name. This command adds some additional details before and after the package name & activity name, but you can still try it out just to verify that the results from the above command are same.
This command is – dumpsys window windows | grep -E ‘mFocusedApp’ .

Method 2: Using APK Info app

APK Info is an app which you can download from Play Store, and it will provide the appPackage and appActivity name of any app which is installed on your mobile device.

Step 1: Download “APK Info” app from Play Store.  Open it and check that it lists down all the apps that you have on your phone.

Step 2: Long press on the “Desired App” application icon inside the APK Info app till it displays the list of options. Click the option “Detailed Information” option. It would show the detailed log for the app.

Step 3: Then to find the appActivity name of the app, scroll down to the sub-section “Activities”. This sub-section displays all the activities that are available for the app. From this list, you have to look for the activity which has “MainActivity” or “Main” or “Login” in the activity name.

5. 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.

6. Explain how to find DOM element or xPath in a mobile application?
Answer: To find the DOM element we can use “UI Automater Viewer” to find DOM element for Android application.

7. Explain the design concept of Appium?
–Appium is a HTTP Server written in Node.js platform, and drives Android and iOS sessions 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.

8. What mobile web browsers can I automate in the Android emulator?
Answer: 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.

9. List out the pre-requisite to use APPIUM?
Answer: Pre-requisite to use APPIUM is
Selenium Server JAR
Webdriver Language Binding Library
APPIUM for Windows
APK App Info On Google Play

10. What language does Appium support?
Answer: Appium support any language that support HTTP request like Java, JavaScript with Node.js, Python, Ruby, PHP, Perl, etc.

Leave a Reply