Create UI Identifiers
Testsigma provides a UI Identifiers page which is helpful for the testers to manage UI Identifiers while avoiding duplicates and without modifying the Test Scripts directly.
Appium and Android Studio installed and configured for automation of Android Apps.
Please refer the following article for more details - Configuring your Windows/Mac/Linux PC and Android device for Hybrid Test Execution
We can navigate to the UI Identifiers page by going through:
Applications > Select Application > Select Version > UI Identifiers
The landing page looks as given below:
On the top right corner, we can see three buttons. They are:
- Import: Use this option to import UI Identifiers from an Excel or JSON file. Please check this article for more details - How to Import UI Identifiers?
- Copy from Other Version: Use this option to copy the UI Identifiers from another Version of the same Application in Testsigma. Please check this article for more details - How to Copy UI Identifiers from one Application Version to another?
- Create: We will be discussing creating UI Identifiers in the following section.
Creating UI Identifiers - without Advanced Options
Clicking on the Create button on the top right corner opens the Create UI Identifier page with the input fields mentioned below.
Enter the details as given below:
Name: Enter the name that is used for UI Identifier.
Screen Name: Screen Name will be helpful to group you identifiers by each screen in your application. This helps to you search identifiers in each screen in your application.
Advanced Options: Use advanced options to create an XPath or CSS Selector interactively using the Testsigma UI Identifier creator. Please check the following article for a detailed guide on using Advanced Options - How to create UI Identifier with Advanced Options?
Identifier Type: Select the suitable locator from a drop-down box:
- link text
- partial link text
- class name
- tag name
UI Identifier: Enter the value for the UI Identifier type you previously selected. Check the following section Getting UI Identifier using Appium Inspector to know how to get the UI identifier for your Android App using Appium's built-in Inspector.
Finally, click on Create button to finalize the creation. You can see the success notification for the newly created UI Identifier.
Getting the UI Identifier using Appium Inspector
Assuming the prerequisites as given in the above Prerequisites section are satisfied, we can start the Inspection as follows:
1. Connect your Android Device.
2. Open Command Prompt(Windows) or Terminal(Mac or Linux) on your Machine.
3. Type adb devices to start the ADB daemon if not already running. Make sure the Serial number for the connected device shows up.
4. Start the Appium Server using Appium Desktop if not already running.
5. Start the UI Inspector session by clicking on Start new session on the top right corner.
6. The UIAutomator will start up and will start loading a screenshot from the connected Android Device.
7. Click on the required Element and copy the resource ID or XPath from the right panel.
8. Paste the UI Identifiers in the Create UI Identifiers page and Click on Create.
9. Perform the required actions such as Tap, Click, or Drag on the device and select the next Element in the Inspector.
10. Repeat Steps 7 to 9 till you get all the required UI Identifiers.
Here's a short video depicting the steps: