# US 11,656,976 B2 · System and method for element locator recommendations for a UI application

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,656,976 B2
- Document ID: US11656976B2
- Status: Granted
- Kind: B2
- Application number: 17/221,259
- Filed: 2021-04-02
- Published: 2021-10-07
- Granted: 2023-05-23
- Earliest claimed: 2020-04-02
- Assignees: Parasoft Corporation
- Applicants: Parasoft Corporation
- Inventors: Nathan Michael Jakubiak; Anthony David Yoshicedo; Joseph Adam Benken
- Web page: https://patentgrep.com/patent/US11656976B2

## CPC

- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 9/451: Execution arrangements for user interfaces
- G06F 9/453: {Help systems}
- G06F 11/3676: {for coverage analysis}
- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F 11/3692: {for test results analysis}
- G06F 40/14: Tree-structured documents (parsing G06F40/205; validation G06F40/226)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

System and method for element locator recommendations for testing a UI application include: executing tests; monitoring tests and observing which commands are called by each test to generate monitored data, where the monitored data includes which tests were executed, element locators that were used in the tests, relevant commands that were called by each test and related to the element locators that were used in the tests, and information about the UI application during the test execution; storing the monitored data; analyzing the stored monitored data; producing a set of recommended element locators to be used in place of previously used element locators for which the elements were not found during the execution of the tests; and utilizing the set of recommended element locators to complete the testing of the UI application software.

## Claims

### Claim 1

A method for element locator recommendations for testing a User Interface (UI) application software by a test tool, the method comprising: executing a plurality of tests by the test tool; monitoring tests as they are executed and observing which commands of the test tool are called by each test being executed to generate monitored data, wherein the monitored data includes which tests were executed, element locators that were used in the tests, relevant commands that were called by each test and related to the element locators that were used in the tests, and information about the UI application software during the test execution; storing the monitored data in a recorded data repository; analyzing the monitored data stored in the recorded data repository; producing a set of recommended element locators to be used by the test tool in place of previously used element locators for which elements were not found during the execution of the tests; when a wait condition is a test, injecting additional time for the wait condition to complete; producing a confidence factor for each recommended locator, wherein the confidence factor is based on how often a locator of same type would have had a consistent value when created for each of a plurality of historical test executions; and utilizing the confidence factors to select a recommended element locator form the set of recommended element locators to complete the testing of the UI application software.

### Claim 2 (depends on 1)

The method of claim 1, further comprising storing data for each relevant command.

### Claim 3 (depends on 2)

The method of claim 2, wherein the stored data for each relevant command includes an element locator for a page element associated with the relevant command, data passed to the relevant command, and a current Document Object Model (DOM) structure of the UI application software associated with the relevant command at a moment that the relevant command is executed.

### Claim 4 (depends on 3)

The method of claim 3, wherein the stored data for each relevant command further includes command name, whether the command succeeded or failed, an absolute XPath to the page element that was found using the element locator within the DOM structure of the page.

### Claim 5 (depends on 3)

The method of claim 3, wherein analyzing the monitored data comprises identifying a page element within the DOM structure that was stored when the command was executed.

### Claim 6 (depends on 5)

The method of claim 5, further comprising creating a set of locators by analyzing the identified page element and the associated DOM structure of a page that includes the identified page element.

### Claim 7 (depends on 6)

The method of claim 6, further comprising utilizing the associated DOM structure to identify the page element, and identifying the relevant command from a previous test run that matches the relevant command under analysis.

### Claim 8 (depends on 7)

The method of claim 7, wherein the page element is identified by matching the DOM structure.

### Claim 9 (depends on 7)

The method of claim 7, wherein the page element is identified by creating a second set of locators for an associated DOM structure for a previous test run and using the second set of locators to identify the associated page element.

### Claim 10 (depends on 1)

The method of claim 1, further comprising utilizing the set of recommended element locators to produce a report to improve the tests.

### Claim 11 (depends on 1)

The method of claim 1, wherein monitoring tests as they are executed comprises monitoring application programming Interface (API) calls made by the tests being executed and the test tool, and storing data from the API calls.

### Claim 12 (depends on 1)

The method of claim 1, wherein the plurality of tests are Java™ classes and are stored within a source control management system, and wherein the monitoring is performed as a Java Agent™.

### Claim 13 (depends on 1)

The method of claim 1, further comprising when an element cannot be found, injecting a wait condition to complete the test.

### Claim 14

A system for element locator recommendations for testing a User Interface (UI) application software comprising: a software test tool for executing a plurality of tests by the test tool; a monitor for monitoring tests as they are executed and observing which commands of the test tool are called by each test being executed to generate monitored data, wherein the monitored data includes which tests were executed, element locators that were used in the tests, relevant commands that were called by each test and related to the element locators that were used in the tests, and information about the UI application software during the test execution; a data repository for storing the monitored data; and a locator creation engine for analyzing the monitored data stored in the data repository, producing a set of recommended element locators to be used by the test tool in place of previously used element locators for which elements were not found during the execution of the tests, when a wait condition is a test, injecting additional time for the wait condition to complete, and producing a confidence factor for each recommended locator, wherein the confidence factor is based on how often a locator of same type would have had a consistent value when created for each of a plurality of historical test executions; and wherein the software test tool utilizes the confidence factors to select a recommended element locator form the set of recommended element locators to complete the testing of the UI application software.

### Claim 15 (depends on 14)

The system of claim 14, wherein data for each relevant command includes an element locator for a page element associated with the relevant command, data passed to the relevant command, whether the command succeeded or failed, an absolute XPath to the page element that was found using the element locator within the DOM structure of the page, and a current Document Object Model (DOM) structure of the UI application software associated with the relevant command at the moment that the relevant command is executed.

### Claim 16 (depends on 15)

The system of claim 15, wherein analyzing the monitored data comprises identifying a page element within the DOM structure that was stored when the command was executed.

### Claim 17 (depends on 15)

The system of claim 15, wherein the locator creation engine creates a set of locators by analyzing the identified page element and the associated DOM structure of a page that includes the identified page element, and utilizing the associated DOM structure to identify the page element, and identifying the relevant command from a previous test run that matches the relevant command under analysis.

### Claim 18 (depends on 17)

The system of claim 17, wherein the page element is identified by matching the DOM structure.

### Claim 19 (depends on 17)

The system of claim 17, wherein the page element is identified by creating a second set of locators for an associated DOM structure for a previous test run and using the second set of locators to identify the associated page element.

### Claim 20 (depends on 14)

The system of claim 14, wherein the software test tool utilizes the set of recommended element locators to produce a report to improve the tests.
