Automatic updating of graphical user interface element locators based on dimension comparison
Abstract
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.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1. A method for testing software applications, the method comprising:
identifying a plurality of user interface elements (UI elements) within a user interface (UI) of an application, each UI element having a locator associated therewith;
capturing, with respect to each UI element in the plurality of UI elements, dimension information comprising at least one of:
the coordinates of the UI element; or
the physical dimensions of the UI element;
storing the dimension information in a database;
during a test of the application, determining that a missing UI element cannot be located using a locator associated with the missing UI element, wherein the missing UI element is one of the plurality of UI elements;
retrieving the dimension information associated with the missing UI element from the database;
recognizing the missing UI element at a new location within the UI based at least in part on the dimension information; and
updating the locator associated with the recognized missing UI element to reflect its new location.
2. The method of claim 1 , wherein the coordinates of the UI element comprise the x-coordinate and the y-coordinate of the UI element's location on a page of the UI, and the physical dimensions of the UI element comprise at least one of the width of the UI element or the height of the UI element.
3. The method of claim 1 , further comprising:
identifying at least one page where the missing UI element is located;
identifying UI elements located on the at least one page;
wherein the missing UI element is recognized among the identified UI elements.
4. The method of claim 1 , further comprising:
capturing the type of each UI element in the plurality of UI elements and storing the type of each UI element in the database;
determining the type of the missing UI element based on the database;
wherein, recognizing the missing UI element within the UI is further based on the missing UI element's type.
5. The method of claim 1 , further comprising:
determining the missing UI element's type;
wherein, recognizing the missing UI element within the UI is further based on the missing UI element's type.
6. The method of claim 1 , further comprising:
after locating the missing UI element, determining a new locator for the missing UI element; and
executing a new test of the application, the new test configured to locate the missing UI element by using the new locator.
7. The method of claim 1 , wherein a UI element comprises at least one of the following types of UI elements: button, checkbox, radio button, drop-down list, text input box, window, hyperlink, slider, menu, or file-select control.
8. A computing device, comprising:
at least one processor; and
memory including instructions that, when executed by the at least one processor, cause the computing device to:
identify a plurality of user interface elements (UI elements) within a user interface (UI) of an application, each UI element having a locator associated therewith;
capture, with respect to each UI element in the plurality of UI elements, dimension information comprising at least one of:
the coordinates of the UI element; or
the physical dimensions of the UI element;
store the dimension information in a database;
during a test of the application, determine that a missing UI element cannot be located using a locator associated with the missing UI element, wherein the missing UI element is one of the plurality of UI elements;
retrieve the dimension information associated with the missing UI element from the database;
recognize the missing UI element at a new location within the UI based at least in part on the dimension information; and
update the locator associated with the recognized missing UI element to reflect its new location.
9. The computing device of claim 8 , wherein the coordinates of the UI element comprise the x-coordinate and the y-coordinate of the UI element's location on a page of the UI, and the physical dimensions of the UI element comprise at least one of the width of the UI element or the height of the UI element.
10. The computing device of claim 8 , wherein the memory further includes instructions that when executed by the at least one processor, cause the computing device to:
identify at least one page where the missing UI element is located;
identify UI elements located on the at least one page;
wherein the missing UI element is recognized among the identified UI elements.
11. The computing device of claim 8 , wherein the memory further includes instructions that when executed by the at least one processor, cause the computing device to:
capture the type of each UI element in the plurality of UI elements and storing the type of each UI element in the database;
determine the type of the missing UI element based on the database;
wherein, recognizing the missing UI element within the UI is further based on the missing UI element's type.
12. The computing device of claim 8 , wherein the memory further includes instructions that when executed by the at least one processor, cause the computing device to:
determine the missing UI element's type;
wherein, recognizing the missing UI element within the UI is further based on the missing UI element's type.
13. The computing device of claim 8 , wherein the memory further includes instructions that when executed by the at least one processor, cause the computing device to:
after locating the missing UI element, determine a new locator for the missing UI element; and
execute a new test of the application, the new test configured to locate the missing UI element by using the new locator.
14. The computing device of claim 8 , wherein a UI element comprises at least one of the following types of UI elements: button, checkbox, radio button, drop-down list, text input box, window, hyperlink, slider, menu, or file-select control.
15. A non-transitory computer readable storage medium comprising one or more sequences of instructions, the instructions when executed by one or more processors causing the one or more processors to execute the operations of:
identifying a plurality of user interface elements (UI elements) within a user interface (UI) of an application, each UI element having a locator associated therewith;
capturing, with respect to each UI element in the plurality of UI elements, dimension information comprising at least one of:
the coordinates of the UI element; or
the physical dimensions of the UI element;
storing the dimension information in a database;
during a test of the application, determining that a missing UI element cannot be located using a locator associated with the missing UI element, wherein the missing UI element is one of the plurality of UI elements;
retrieving the dimension information associated with the missing UI element from the database;
recognizing the missing UI element at a new location within the UI based at least in part on the dimension information; and
updating the locator associated with the recognized missing UI element to reflect its new location.
16. The non-transitory computer readable storage medium of claim 15 , wherein the coordinates of the UI element comprise the x-coordinate and the y-coordinate of the UI element's location on a page of the UI, and the physical dimensions of the UI element comprise at least one of the width of the UI element or the height of the UI element.
17. The non-transitory computer readable storage medium of claim 15 , further comprising instructions that when executed by the one or more processors cause the one or more processors to execute the operations of:
identifying at least one page where the missing UI element is located;
identifying UI elements located on the at least one page;
wherein the missing UI element is recognized among the identified UI elements.
18. The non-transitory computer readable storage medium of claim 15 , further comprising instructions that when executed by the one or more processors cause the one or more processors to execute the operations of:
capturing the type of each UI element in the plurality of UI elements and storing the type of each UI element in the database;
determining the type of the missing UI element based on the database;
wherein, recognizing the missing UI element within the UI is further based on the missing UI element's type.
19. The non-transitory computer readable storage medium of claim 15 , further comprising instructions that when executed by the one or more processors cause the one or more processors to execute the operations of:
determining the missing UI element's type;
wherein, recognizing the missing UI element within the UI is further based on the missing UI element's type.
20. The non-transitory computer readable storage medium of claim 15 , further comprising instructions that when executed by the one or more processors cause the one or more processors to execute the operations of:
after locating the missing UI element, determining a new locator for the missing UI element; and
executing a new test of the application, the new test configured to locate the missing UI element by using the new locator.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.