UI Element Locator Auto-Update via Dimension Comparison
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Automated software testing becomes inefficient when an application's code is refactored, as locators for user interface elements change, requiring manual updates that are burdensome and costly, especially in rapidly evolving software environments.
Innovation Solution
The system captures snapshots and dimension information of UI elements during an initial test and stores them in a database, allowing for automatic locator updates by image and dimension comparison if the original locator becomes invalid, ensuring accurate identification of UI elements even after code refactoring.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If automated testing software uses locators to identify UI elements, then testing efficiency is improved, but when code is refactored and locators change, manual updates become necessary which reduces efficiency and increases cost
Solution Approach 1:
The system automatically detects when UI elements change by comparing snapshots and dimension information, then self-updates the locators without requiring manual intervention. This self-service mechanism resolves the contradiction by maintaining high testing efficiency while eliminating the maintenance burden that would otherwise result from code refactoring.
Solution Approach 2:
The system monitors changes in dimension parameters (width, height, position) of UI elements and uses these parameter changes to automatically update locators. By detecting parameter changes and responding automatically, the system maintains testing efficiency while adapting to code refactoring without manual updates.
2Reliability
If manual updates are performed to maintain accurate locators after code refactoring, then locator accuracy is maintained, but time and cost increase significantly
Solution Approach 1:
The system captures snapshots and dimension information of UI elements in advance during the initial test execution. When code refactoring occurs, this pre-captured information serves as a baseline for automatic comparison and update, ensuring locator accuracy is maintained without requiring time-consuming manual updates.
Solution Approach 2:
The system continuously compares current UI element snapshots and dimensions against stored baseline information, detects discrepancies automatically, and feeds this information back to update locators. This closed-loop feedback mechanism maintains locator accuracy while eliminating the time loss associated with manual updates.
3Adaptability or versatility
If code refactoring is performed frequently to deliver updates and fixes, then software adaptability is improved, but automated testing software becomes increasingly difficult to maintain
Solution Approach 1:
The automated testing system performs self-updates by automatically detecting UI element changes through snapshot and dimension comparison, then self-corrects locator information. This self-service capability allows the system to adapt to frequent code refactoring without increasing maintenance complexity, as no additional manual intervention is required.
Solution Approach 2:
The system dynamically adapts to code refactoring by continuously monitoring UI element dimensions and snapshots, automatically adjusting locators in response to changes. This dynamic adaptation mechanism enables the software to handle frequent refactoring events while keeping testing maintenance complexity low through automation.
Data Source
AI summary
An automated testing system is described for efficient testing of software applications. Locators are used by the test to find user interface elements in an application's graphical user interface during testing. If during a test a user interface element is not found, which may be due to a changed locator during code refactoring, the system finds the user interface element based on the element's type and on previously stored information about the element. Such information can be a snapshot image of the element, the coordinates of the element's location, dimensions of the element, or other information. Once the missing element is found, a new locator for the element is read and the test is performed using the new locator.


