# US 2024/0403002 A1 · Code annotation and test coverage visualization on user interface by leveraging page object design pattern

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

- Number: US 2024/0403002 A1
- Document ID: US20240403002A1
- Status: Published application
- Kind: A1
- Application number: 18/205,943
- Filed: 2023-06-05
- Published: 2024-12-05
- Earliest claimed: 2023-06-05
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Jin Shi; Chao Yuan Huang; Chun-Sheng Chung; Fan Yang; Rong Chen
- Web page: https://patentgrep.com/patent/US20240403002A1

## CPC

- G06F 8/34: Graphical or visual programming
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In one general embodiment, a computer-implemented method includes analyzing document object model code for generating locators of elements of a web page. The locators are output visibly on a user interface displaying the web page. A page object code template of the web page is generated. Mappings of the elements and/or the locators to page object variables are received from a user. Representations of the mappings are output visibly on the user interface displaying the web page. Mappings from page areas of the web page to page object functions are received from the user. Representations of the mappings from the page areas of the web page to the page object functions are output visibly on the user interface displaying the web page. Code references are rendered on the user interface displaying the web page.

## Claims

### Claim 1

A computer-implemented method, comprising:
analyzing document object model code for generating locators of elements of a web page;
outputting the locators visibly on a user interface displaying the web page;
generating a page object code template of the web page;
receiving, from a user, mappings of the elements and/or the locators to page object variables;
outputting representations of the mappings visibly on the user interface displaying the web page;
receiving, from the user, mappings from page areas of the web page to page object functions;
outputting representations of the mappings from the page areas of the web page to the page object functions visibly on the user interface displaying the web page; and
rendering code references on the user interface displaying the web page.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, comprising receiving business logic for at least some of the elements of the web page; receiving test logic for testing the business logic; invoking the test logic; mapping object variables invoked by the test logic to one of the page areas; and outputting a representation of the page area on the user interface displaying the web page.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein generating the page object code template of the web page includes defining a class for a particular function enabled by a particular set of the elements, and comprising outputting a representation of the class and variables corresponding thereto.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, wherein the mappings from page areas of the web page to page object functions include a mapping from one of the page areas to the class.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4, comprising receiving business logic for the elements of the web page in the class; receiving test logic for testing the business logic; invoking the test logic; mapping the object variables invoked by the test logic to one of the page areas; and outputting a representation of the page area on the user interface displaying the web page.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, comprising receiving a selection of one of the objects on the user interface; and in response to receiving the selection, outputting a code block associated with the object.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein generating the page object code template of the web page includes analyzing page object model code of a web page object corresponding to the web page.

### Claim 8

A computer program product, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a computer to cause the computer to:
analyze, by the computer, document object model code for generating locators of elements of a web page;
output, by the computer, the locators visibly on a user interface displaying the web page;
generate, by the computer, a page object code template of the web page;
receive, by the computer from a user, mappings of the elements and/or the locators to page object variables;
output, by the computer, representations of the mappings visibly on the user interface displaying the web page;
receive, by the computer from the user, mappings from page areas of the web page to page object functions;
output, by the computer, representations of the mappings from the page areas of the web page to the page object functions visibly on the user interface displaying the web page; and
render, by the computer, code references on the user interface displaying the web page.

### Claim 9 (depends on 8)

The computer program product of claim 8, comprising program instructions executable by the computer to cause the computer to: receive business logic for at least some of the elements of the web page; receiving test logic for testing the business logic; invoke the test logic; map object variables invoked by the test logic to one of the page areas; and output a representation of the page area on the user interface displaying the web page.

### Claim 10 (depends on 8)

The computer program product of claim 8, wherein generating the page object code template of the web page includes defining a class for a particular function enabled by a particular set of the elements, and comprising program instructions executable by the computer to cause the computer to output a representation of the class and variables corresponding thereto.

### Claim 11 (depends on 10)

The computer program product of claim 10, wherein the mappings from page areas of the web page to page object functions include a mapping from one of the page areas to the class.

### Claim 12 (depends on 11)

The computer program product of claim 11, comprising program instructions executable by the computer to cause the computer to: receive business logic for the elements of the web page in the class; receiving test logic for testing the business logic; invoke the test logic; map the object variables invoked by the test logic to one of the page areas; and output a representation of the page area on the user interface displaying the web page.

### Claim 13 (depends on 8)

The computer program product of claim 8, comprising program instructions executable by the computer to cause the computer to receive a selection of one of the objects on the user interface, and in response to receiving the selection, output a code block associated with the object.

### Claim 14 (depends on 8)

The computer program product of claim 8, wherein generating the page object code template of the web page includes analyzing page object model code of a web page object corresponding to the web page.

### Claim 15

A system, comprising:
a processor; and
logic integrated with the processor, executable by the processor, or integrated with and executable by the processor, the logic being configured to:
analyze document object model code for generating locators of elements of a web page;
output the locators visibly on a user interface displaying the web page;
generate a page object code template of the web page;
receive, from a user, mappings of the elements and/or the locators to page object variables;
output representations of the mappings visibly on the user interface displaying the web page;
receive, from the user, mappings from page areas of the web page to page object functions;
output representations of the mappings from the page areas of the web page to the page object functions visibly on the user interface displaying the web page; and
render code references on the user interface displaying the web page.

### Claim 16 (depends on 15)

The system of claim 15, comprising logic for: receiving business logic for at least some of the elements of the web page; receiving test logic for testing the business logic; invoking the test logic; mapping object variables invoked by the test logic to one of the page areas; and outputting a representation of the page area on the user interface displaying the web page.

### Claim 17 (depends on 15)

The system of claim 15, wherein generating the page object code template of the web page includes defining a class for a particular function enabled by a particular set of the elements, and comprising outputting a representation of the class and variables corresponding thereto.

### Claim 18 (depends on 17)

The system of claim 17, wherein the mappings from page areas of the web page to page object functions include a mapping from one of the page areas to the class.

### Claim 19 (depends on 18)

The system of claim 18, comprising receiving business logic for the elements of the web page in the class; receiving test logic for testing the business logic; invoking the test logic; mapping the object variables invoked by the test logic to one of the page areas; and outputting a representation of the page area on the user interface displaying the web page.

### Claim 20 (depends on 15)

The system of claim 15, comprising logic for receiving a selection of one of the objects on the user interface; and logic for outputting a code block associated with the object in response to receiving the selection.
