Test Execution of Android applications in Testsigma(or in General) requires a few characteristic details about the Application in order to locate the Application and the specific feature in the Application that is to be tested. They are:
- App Package Name
- App Activity Name
Every Android app has a unique application ID that looks like a Java package name, such as "com.example.myapp". This ID uniquely identifies your app on the device and in Google Play Store.
Furthermore, Each Android Application contains a number of Activities or Pages and each Activity contains a number of elements such as fields or buttons that we need to test.
A simpler analogy is,
"An Activity in an Android Application is to a Web page in a Web Application or Website"
Testsigma requires the App Package name to locate the Application and App Activity name to pinpoint the Page to be tested.
Finding App Package and Activity
We can find the App details using the Command Prompt (CMD) or Terminal using the Android Debugging Bridge (ADB) interface.
The prerequisite conditions for finding the App details are:
- The Application whose details are required should be open on the Android Device or Emulator that is connected to the Computer.
- The Android Device and the Computer should be connected to the Internet.
- Android SDK should be installed and set up on the Computer.
Let us try finding the details of well-known Whatsapp app in this case.
Please follow the steps given below:
1. Firstly, open a Command Prompt(CMD) Window. You can do this either
- by searching for 'cmd' in Start Menu or,
- by opening Run Application, Typing in 'cmd' and pressing Enter Key.
2. Next, type in ‘adb devices‘ in the CMD window and press Enter. A list of Android devices connected to the Computer is displayed along with their device IDs as shown below:
For now, we have only one device connected to this System.
3) Type in ‘adb shell’ to get into an interactive shell for the android device. Now we can perform administrative operations on the Android device.
4. Finally, type the below-given command to get the information about the currently open application, i.e in our case, WhatsApp.
dumpsys window windows | grep -E ‘mCurrentFocus|mFocusedApp'
The Android Application Package name and Application Activity name are shown as given below:
Here, the part before the backslash "com.whatsapp" is the Package name and the part after the backslash "com.whatsapp.HomeActivity"
Note: We need to make sure that the WhatsApp application is opened on the device and device is not locked before the procedure. We can use the same method for finding the details of any Application installed on the device.
Also, you can find the package name of an Application in the More Details section of the Application details page in Google Play Store.