Mobile Testing
Mobile Apps Testing: Sample Test Cases & Test Scenarios
A frequent question from our learner's is How to test Mobile Apps? In this tutorial, we provide...
Using any real device for mobile automation Testing is always been a challenge for testers. But, Android offers a handful solution to connect a real device over USB i.e. Android Debug Bridge (ADB).
ADB is a command line tool. It is used to bridge communication between an emulator instance (Android device) and background running daemon process (server).
In this tutorial, you will learn-
APPIUM offers an advantage to execute test on real devices. But prior to run the test, we need to setup following pre-requisite.
Here we will see both, connecting to emulator as well as with real device for testing. See steps below for connecting to an emulator.
Pre-Requisite- SDK (Software Development Kit) should be installed on the machine. ADB is packaged with Google's Android SDK (Software Development Kit). Steps to enable ADB from SDK Manager.
Step 1) Open Android SDK folder
Step 2) Double click on SDK Manager
Step 3) From the list of all packages select Tools and mark the checkbox for
Step 1) Enable USB debugging option from 'Developer Option' in Android phone.
Step 2) Open the local folder where Android SDK files has been saved 'Android SDK >> Platform-tools' eg: C:\android-sdk\platform-tools
Step 3) Inside folder hold Shift + Right click menu >> Select 'Open command window here' option.
It will open the folder using command prompt.
Note- you can also open the folder path directly from the Run command in command prompt.
This command window will directly open the folder in command prompt window.
Step 4) Now, prior to check the device, user have to connect an external Android device (mobile phone). To connect use the device USB cable connector to the system. Then in above command prompt type command-
'adb devices' & press Enter
It will display all list of all the connected devices.
But, prior to this we should check that ADB server. Check whether it is running as background process or not. Just open the command prompt from above mentioned procedure and write 'adb' and press enter. It should display all the adb's process running.
When server starts, it always bind the local TCP port 5037. All ADB clients listen to 5037 TCP port to communicate with server request.
Now, the running ADB server can scan all connected emulator or device instances by scanning the port.
Always remember that ADB daemon runs on odd numbered port between the ranges of 5555 to 5558.
ADB daemon process runs with console connection that acquires even number port for connection.
For example: If single device connected then server automatically scan the device and get connected but if multiple device or emulator running the user need to give ADB command line instruction to connect.
The emulator instance connected on odd numbered port 5557 has the same console running over even numbered 5556 port ie. Each running devices has 1 odd and 1 even connected port.
emulator 1: console 5556 emulator 1: adb 5557 emulator 2: console 5554 emulator 2: adb 5555
Command to detect all connected device -
<$ adb devices> emulator-5554 device emulator-5556 device emulator-5558 device
Command detecting a single device from multiple connected devices-
<$ adb –s emulator-5554 install gtupapers.apk>
It will detect the adb connection for device -5554 and install the application.
So, this way user can set up a successful connection to access ADB instances using ADB commands.
Syntax used to access ADB instances from commands line: Adb [-d – An adb command when a single USB device is connected Adb [-e – An adb command when only single emulator is running Adb devices--- This will print all the list of emulator / devices attached. Adb version--- List the adb version number. Adb help---- Print the list of supported commands.
Just like configuring ADB over USB, user can also configure ADB over wi-fi.
Pre-requisite
$ adb tcpip 5555
Use the same IP address to connect the device via ADB connection
eg: Network IP address is- 148.100.1.17 $ adb devices List of devices attached 148.100.1.17:5555 device
Hence, the final configuration done and 'adb' successfully configured over wireless network.
NOTE- If any connection error occurred just reset or kill the adb host connection. For that use following command
<adb kill server> and again connect from first step.
A frequent question from our learner's is How to test Mobile Apps? In this tutorial, we provide...
In this tutorial, you will learn- What is Real Testing Device? What is Emulators? Difference...
For any mobile app, performance is very critical. If your Mobile App does not perform well, the...
Training Summary Android & iOS are the most popular mobile OS. There are millions of application designed...
What is Game Testing? Game Testing is a software testing process for testing video games for...
Have you ever developed an Android application and publish it to Google Play? What will you do if...