Appium Interview Questions and Answers – Part 3 (10 Questions)
Q1) What is adb?
Answer: The following are the points for understanding adb:
- > adb stands for Android Debug Bridge.
- > adb allows you to do things in your Android Mobile Device, that may not be suitable for your everyday use in real devices or emulators.
- > adb is an internal component of Android Studio.
- > If you have installed Android Studio, adb will be installed by default with it
- > We can only use adb via command prompt
- > Usage of adb
- – You can get list of devices attached
- – You can install an application through adb
- – Copy a file from your computer to devices
Q2) Where can I see adb in my machine?
Answer: After installing Android studio, navigate to below path: C:\Users\<username>\AppData\Local\Android\sdk\platform-tools as shown below:
Q3) Do we need to add any configurations to use adb?
Answer: Yes, we need to set adb path in Environment Configurations.
If we run adb commands in the command prompt without setting path, following error will be displayed in command prompt as shown below:
Q4) How to set adb path?
Answer: Follow the below steps to set the adb path in Environment variables:
1) Open Windows Explorer, right click on ‘My Computer’ and then select ‘Properties’ option as shown below:
2) Click ‘Advanced System Settings’ on the left side of the displayed window as shown below:
3) Click on ‘Environment Variables’ button as shown below:
4) Select Path ‘System Variable’ and click on ‘Edit’ button as shown below:
5) Now, copy the following two paths into the Path variable and click on ‘OK’ button as shown below:
C:\Users\<username>\AppData\Local\Android\sdk\platform-tools
C:\Users\<username>\AppData\Local\Android\sdk\tools
Username: your user name
6) Click ‘OK’ button on the ‘System Properties’, close and relaunch the command prompt and execute ‘adb’ command as shown below:
Note: You will see the adb version and the installation path on the above command execution.
This confirms that adb is successfully set in your machine.
Q5) What is the adb command for checking the list of devices connected?
Answer: Open command prompt and execute ‘adb devices’ command as shown below:
If you are running the adb commands for the first time, you will see the adb demon getting started. As there are no phones or emulators connected so far, we will not see any devices listed under Devices list in the command prompt on execution of the ‘adb devices’ command as shown below:
Q6) What are the different types of Desired Capabilities for Android App in Appium? Also, write the code.
Answer: Desired Capabilities tell the Appium, all kinds of important information on how you want to test your app and the device on which you want to test your app and so on. The below details will explain few important desired capabilities in Appium for android:
- > ‘platformName‘ Desired Capability – To define device OS platform iOS/Android
- > ‘platformVersion‘ Desired Capability – Version of the OS
- > ‘deviceName‘ Desired Capability – Name of the device (Gala x4, iPhone Emulator etc.)
- > ‘App‘ Desired Capability – Path of App .apk/.ipa to automate
- > ‘newCommandTimeout‘ Desired Capability – How much time (in seconds), do you want Appium to wait until the next command is received.
Q7) How to pass Mobile App path to desired capabilities?
Answer: The following the code for passing Mobile app path to the desired capabilities:
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(“app”.”path/to/app”);
Q8) What is the default timeout to receive a command in Appium?
Answer: Appium has inbuilt instructions to wait for some time to receive any type of command for the automation code. The default timeout is 60 seconds. We can increase the timeout with following desired capability code:
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(“newCommandTimeout”, “time in seconds”);
Q9) What happens if no command is received by Appium within the timeout set?
Answer: Appium will abort the automation script execution, if it doesn’t receive the commands within in the configured time of timeout setting.
Q10) Is it possible to automate mobile browsers with Appium?
Answer: Yes, we can automate the applications on the default mobile browser without any need of 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.
Please upload complete appium tutorials only installation is done later what to do…
We are posting Complete Appium Tutorials at QAFox. Please keep checking the page for Appium Tutorials here: https://www.qafox.com/automation/appium-test-automation-tutorial/