- Print
- DarkLight
What is Quick Element Update?
If there is a step in test results where the intended element was not tapped or if the Swipe To Element step failed to find the target element, the Quick Element Update feature allows you to easily reselect the element from the test results page so that the correct element is tapped or swiped in the next test run.
The advantage of Quick Element Update is that you can quickly make updates without re-recording. There is no need to launch the Autify Recorder and replay all the previous steps in order to update the target step.
Quick Element Update is available for Tap actions and Swipe To Element actions.
Quick Element Update can be used regardless of whether the step passed or failed, making it useful in a variety of situations.
Using Quick Element Update
To use Quick Element Update, open the Test Result Details Page, go to the step in which the intended element was not found, and click the “Update Element” button at the lower right corner.
1. Update via image recognition
This is a straightforward method where you update from the screenshot.
In the test result screenshot, click on the element you want to select and click the “Update Element” button.
When Autify searches for an element using image recognition, it locates elements based on the appearance of the area around the position you tapped or swiped during recording. Therefore, selecting an element or an area around it that has a distinctive appearance will ensure that the element is tapped more reliably.
See also: image recognition tips.
2.Specify (update) the XPath
If Autify cannot reliably find the target element using image recognition, such as when the element's appearance changes frequently, updating the XPath may be effective. This is an option where you specify the element's XPath, which you can get from the page source.
Click the “Update Element” button on the bottom right corner of the page.
Then, select "Page Source" as the locator type at the top of the screen.
The actual page is displayed on the left side, and the Page Source is displayed on the right. Make sure that "XPath" is selected at the bottom of the page.
If it is not XPath, select it from the pull-down menu.
For example, in the figure below for specifying the “WaterMelon” element, selecting the target element on the Page Source screen will highlight the corresponding section in the screenshot. Once selected, click “Update Selected Element.”
You can also specify the XPath directly, as shown below. By adding information to the XPath that is necessary to locate the target element and removing unnecessary information, you can make the element selection more reliable than using the auto-generated XPath. For more information, please see XPath tips.
3. Specify (update) the Accessibility ID
Accessibility ID is a unique ID assigned to elements for the purpose of test automation.
If other methods (updating via image recognition and XPath) do not improve the test's reliability, we recommend that you add Accessibility IDs in your application implementation and use them in your tests.
For more information, please refer to Accessibility ID tips.
Similar to XPath, click on "Update Element via XPath" in the upper right corner of the test results screen and select "Accessibility ID" from the pull-down menu.
Enter the Accessibility ID of the element you want to select and click "Update selected element".
After using Quick Element Update
Regardless of which method you use for updating the element, you will see "Step has been updated. Rerun Scenario" on the upper left corner. At this point, you can rerun the scenario by clicking "Rerun Scenario". The updated scenario will be rerun.
Also at the bottom of the page, you will see one of the following:
- "Locator Strategy: Image Recognition" if you updated via image recognition.
- "Locator Strategy: XPath" if you updated via XPath.
- "Locator Strategy: Accessibility ID" if you updated via Accessibility ID.
The details of the XPath or Accessibility ID will not be displayed on this screen. To check the details, please reopen the update page.
After updating, the test result page will show “updated”, confirming that the element in the target step has been updated.
Notes
- Using Quick Element Update will update the scenario's element and screenshot.
- If you duplicate a scenario after using Quick Element Update, the updated content will be carried over to the duplicated scenario. If you duplicate the scenario before using Quick Element Update, the update will not be carried over to the duplicated scenario.
- “Update Element” cannot be undone. If you want to select the same element that was originally selected, use “Update Elements” again and reselect the element.
- If you update an element of a step within a Step Group, it will affect all scenarios that use that Step Group.