Appium Interview Questions and Answers – Part 4 (10 Questions)
Q1) What are the different types of Mobile Browsers does Appium support?
Answer: Appium supports the below two Mobile Browsers:
- > Chrome Browser in Android
- > Safari Browser in iOS
- > Appium can also automate Firefox Browser in Mobile. However we need to pass the capability assuming that you are automating an app and the path for firefox app (.apk or .ipa).
Q2) Does Appium does not support Firefox Browser automation in Android or iOS by default?
Answer: No, Appium can automate Firefox Browser in Mobile too. However we need to pass the capability assuming that you are automating an app and the path for firefox app (.apk or .ipa)
However, Automating Chrome Browser in Android and Safari Browser in iOS, doesn’t need any kind of app files.
Q3) What does .apk stand for?
Answer: .apk stands for Android Application Package.
Q4) What does .ipa stand for?
Answer: .ipa stand for iPhone Application.
Q5) Write a program to launch an App in Android?
Answer: The following is the program for launching the App in Android:
Above Code Explanation
- > Line 10: Created an object for DesiredCapabilities
- > Line 11 – 15: Capabilities that needed for android device (Device name, platform name, Automation name, App path, New Command timeout)
- > Line 16: Creating android driver instance with two parameters (your Appium Server URL and Capabilities)
- > Line 17: Launching App
Q6) How to capture current Appium sessionID?
Answer: We can capture the current Appium sessionID as shown below and use it.
String sessionId = driver.getSessionID().toString();
Q7) How to get Current Appium session Capabilities?
Answer: We can use the below code to capture the current Appium session capabilities:
Map<String, Object> caps = driver.getSessionDetails();
If you print the above caps, you will see the following session capabilities details:
{appPackage=com.google.android.calculator, app=C:\Users\jkotha\Desktop\repo\appium\calc.apk, deviceScreenSize=1080×2160, statBarHeight=66, networkConnectionEnabled=true, warnings={}, viewportRect={left=0, top=66, width=1080, height=1962}, databaseEnabled=false, deviceName=emulator-5554, platform=LINUX, deviceUDID=emulator-5554, desired={platformName=android, app=C:\Users\jkotha\Desktop\repo\appium\calc.apk, automationName=UiAutomator2, deviceName=emulator-5554, newCommandTimeout=200}, newCommandTimeout=200, pixelRatio=2.75, platformVersion=9, automationName=UiAutomator2, locationContextEnabled=false, webStorageEnabled=false, takesScreenshot=true, d eviceModel=Android SDK built for x86, deviceScreenDensity=440, javascriptEnabled=true, deviceManufacturer=Google, deviceApiLevel=28, platformName=android }{appPackage=com.google.android.calculator, app=C:\Users\jkotha\Desktop\repo\appium\calc.apk, deviceScreenSize=1080×2160, statBarHeight=66, networkConnectionEnabled=true, warnings={}, viewportRect={left=0, top=66, width=1080, height=1962}, databaseEnabled=false, deviceName=emulator-5554, platform=LINUX, deviceUDID=emulator-5554, desired={platformName=android, app=C:\Users\jkotha\Desktop\repo\appium\calc.apk, automationName=UiAutomator2, deviceName=emulator-5554, newCommandTimeout=200}, newCommandTimeout=200, pixelRatio=2.75, platformVersion=9, automationName=UiAutomator2, locationContextEnabled=false, webStorageEnabled=false, takesScreenshot=true, d eviceModel=Android SDK built for x86, deviceScreenDensity=440, javascriptEnabled=true, deviceManufacturer=Google, deviceApiLevel=28, platformName=android }
More details:
Along with the capabilities we passed, some default capabilities will be passed for the session.
Default capabilities will overridden by the user updated value if set.
Q8) What is app package for an App?
Answer: appPackage is the technical name of the app given by the developer in which all the code and resources are maintained. For WhatsApp, the appPackage is – ‘com.whatsapp’.
Q9) What is app activity?
Answer: Each app supports different types of functionality, each functionality will have an activity name.
For WhatsApp chat, status, call, camera and settings are different types of functionalities. Each functionality will have separate activity name.
Q10) How to close an App?
Answer: driver.closeApp() Appium command needs to be used for closing an App.
Thank you for Reading this Article. Hope it helped you!!
Happy Learning ?
Connect to me on Linked In (Click here)
On a mission to contribute to the Software Testing Community in all possible ways.