# US 2021/0311862 A1 · 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 2021/0311862 A1
- Document ID: US20210311862A1
- Status: Published application
- Kind: A1
- Application number: 17/221,259
- Filed: 2021-04-02
- Published: 2021-10-07
- 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/US20210311862A1

## 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 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.

### 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 the 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 1)

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

### Claim 6 (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 7 (depends on 6)

The method of claim 6, 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 8 (depends on 7)

The method of claim 7, 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 9 (depends on 8)

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

### Claim 10 (depends on 8)

The method of claim 8, 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 11 (depends on 1)

The method of claim 1, further comprising calculating a score for each recommended element locator to produce a scored list of recommended locators; and using the score by a machine learning engine to determine a best element locator to use in place of a previously used element locator.

### Claim 12 (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 13 (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 14 (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 15

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, and producing a set of recommended element locators to be used by the test tool in place of previously used element locators for which the elements were not found during the execution of the tests, wherein the software test tool utilizes the set of recommended element locators to complete the testing of the UI application software.

### Claim 16 (depends on 15)

The system of claim 15, 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 17 (depends on 15)

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

### Claim 18 (depends on 16)

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

### Claim 19 (depends on 16)

The system of claim 16, 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 20 (depends on 19)

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

### Claim 21 (depends on 19)

The system of claim 19, 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.
