IP Library › Granted Patent US 11,409,640
Granted Patent B2
US 11,409,640 · App. 16/408,074 · Granted Aug 9, 2022

Machine learning based test case prediction and automation leveraging the HTML document object model

Inventor: Sathiyanarayanan Thangam (Bangalore, IN)
Assignee: SAP SE
G06F11/3684G06F3/0482G06F11/3692G06F40/12G06N20/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,409,640
App. No.
16/408,074
Granted
Aug 9, 2022
Kind
B2
Abstract

Techniques are described for predicting test scenarios and generating test case documents and/or automation scripts using machine-learning algorithms. For example, input may be received representing a web page, and an HTML Document Object Model (DOM) of the web page may be analyzed. From the DOM, a plurality of HTML elements may be extracted and processed by a machine-learning algorithm. Based on the processed plurality of HTML elements, a plurality of predictions for test case scenarios may be generated, and converted into a set of human-readable instructions, such as a test case document, and/or a set of machine-readable instructions, such as an automation script. In some instances, a user selection of at least one predicted test scenario from a displayed list of one or more predicted test scenarios is received and corresponding human-readable instructions and/or machine-readable instructions are generated for the selected scenario(s).

Claims (77)

1. A computer-implemented method comprising:

receiving an input representing a web page, the page comprising a plurality of HTML (HyperText Markup Language) elements;

analyzing an HTML Document Object Model (DOM) of the web page, wherein analyzing the HTML DOM comprises:

identifying at least a first container and a second container within the web page by traversing through the web page using DOM scraping, wherein each of the first container and the second container comprises at least one mechanism for receiving user input;

analyzing one or more first-level relationships having a direct relationship between HTML elements within at least one of the first container and the second container, and

analyzing one or more second-level relationships between the first container and the second container;

extracting from the DOM the HTML elements within the first and second containers;

processing the extracted HTML elements utilizing a machine learning algorithm to predict test steps for the extracted HTML elements, wherein the processing is based at least in part on the analyzed one or more first-level relationships and the analyzed one or more second-level relationships;

generating, based on the predicted test steps and the analyzed one or more first-level relationships and the analyzed one or more second-level relationships, at least one prediction for at least one test case scenario; and

converting the at least one prediction into:

a set of human-readable instructions, and

a set of machine-readable instructions.

2. The computer-implemented method of claim 1 , wherein converting the prediction into a set of human-readable instructions comprises generating at least one test case document.

3. The computer-implemented method of claim 2 , wherein the generating at least one test case document comprises:

generating a list of one or more test case scenarios;

receiving user input selecting at least one of the one or more listed test case scenarios; and

generating the test case document based on the at least one selected test case scenario.

4. The computer-implemented method of claim 1 , wherein converting the prediction into a set of machine-readable instructions comprises generating at least one automation script.

5. The computer-implemented method of claim 4 , wherein the generating at least one automation script comprises generating an automation script for at least one selected test case scenario generated in a test case document.

6. The computer-implemented method of claim 4 , wherein the generating at least one automation script comprises:

generating a list of one or more test case scenarios;

receiving user input selecting at least one of the one or more listed test case scenarios; generating at least one test case document based on the at least one selected test case scenario; and

generating the at least one automation script based on the at least one test case document.

7. The computer-implemented method of claim 1 , wherein the extracted HTML elements comprise a plurality of mechanisms for receiving user input.

8. The computer-implemented method of claim 7 , wherein generating the prediction comprises determining one or more potential user actions for one or more of the plurality of user input mechanisms.

9. The computer-implemented method of claim 8 , wherein determining one or more potential user actions for one or more of the plurality of user input mechanisms comprises determining one or more potential user actions for each of the plurality of user input mechanisms.

10. The computer-implemented method of claim 1 , wherein the input comprises a Uniform Resource Locator (URL) or an application name.

11. The computer-implemented method of claim 1 , wherein the set of human-readable instructions comprises:

at least one step corresponding to one or more of the HTML elements within the first container; and

at least one additional step corresponding to one or more of the HTML elements within the second container.

12. A computing system comprising:

one or more memories;

one or more processors coupled to the one or more memories; and

one or more non-transitory computer readable storage media storing instructions that, when executed, cause the one or more processors to perform operations for predicting test cases for a web page, the operations comprising:

receiving an input representing the web page, the page comprising a plurality of HTML (HyperText Markup Language) elements;

analyzing an HTML Document Object Model (DOM) of the web page, wherein analyzing the HTML DOM comprises:

identifying at least a first container and a second container within the web page by traversing through the web page using DOM scraping, wherein each of the first container and the second container comprises at least one mechanism for receiving user input;

analyzing one or more first-level relationships having a direct relationship between HTML elements within at least one of the first container and the second container, and

analyzing one or more second-level relationships between the first container and the second container;

extracting from the DOM the HTML elements within the first and second containers;

processing the extracted HTML elements utilizing a machine learning algorithm to predict test steps for the extracted HTML elements, wherein the processing is based at least in part on the analyzed one or more first-level relationships and the analyzed one or more second-level relationships;

generating, based on the predicted test steps and the analyzed one or more first-level relationships and the analyzed one or more second-level relationships, at least one prediction for at least one test case scenario; and

converting the at least one prediction into:

a set of human-readable instructions, and

a set of machine-readable instructions.

13. The computing system of claim 12 , wherein the at least one prediction comprises a plurality of test case scenarios.

14. The computing system of claim 13 , wherein the operations further comprise:

generating a list of the plurality of test case scenarios;

receiving a user selection of at least one of the plurality of test case scenarios; and

responsive to receiving the user selection, converting the selected at least one of the plurality of test case scenarios into at least one set of human-readable instructions, the at least one set of human-readable instructions comprising a test case document.

15. The computing system of claim 13 , wherein the operations further comprise:

generating a list of the plurality of test case scenarios, wherein the list comprises at least one predicted validation step;

receiving a user selection of at least one of the plurality of test case scenarios comprising a predicted validation step;

responsive to receiving the user selection, converting the selected at least one of the plurality of test case scenarios into at least one set of machine-readable instructions;

using the at least one set of machine-readable instructions, performing validation to test at least one function of the web page, and generating a validation result indicating whether the at least one function of the web page is functioning properly.

16. The computing system of claim 13 , wherein the computing system further comprises a display device, and wherein operations further comprise:

presenting a display to a user comprising a list of the plurality of test case scenarios;

receiving a user selection of at least one of the presented plurality of test case scenarios; and

responsive to receiving the user selection, converting the selected at least one test case scenario into a set of human-readable instructions comprising a test case document and a set of machine-readable instructions comprising an automation script.

17. The computing system of claim 16 , wherein the display is presented in at least one of: a chatbot window, a web application, a standalone desktop application, or a REST API endpoint.

18. A computer-implemented method comprising:

receiving an input representing a web page, the page comprising a plurality of HTML (HyperText Markup Language) elements;

analyzing an HTML Document Object Model (DOM) of the web page, wherein analyzing the HTML DOM comprises:

identifying at least a first container and a second container within the web page by traversing through the web page using DOM scraping, wherein each of the first container and the second container comprises at least one mechanism for receiving user input;

analyzing one or more first-level relationships having a direct relationship between HTML elements within at least one of the first container and the second container, and

analyzing one or more second-level relationships between the first container and the second container;

extracting from the DOM the HTML elements within the first and second containers;

processing the extracted HTML elements utilizing a machine learning algorithm to predict test steps for the extracted HTML elements, wherein the processing is based at least in part on the analyzed one or more first-level relationships and the analyzed one or more second-level relationships;

generating, based on the predicted test steps and the analyzed one or more first-level relationships and the analyzed one or more second-level relationships, a plurality of predictions for test case scenarios;

receiving a user selection of at least one of the plurality of predictions; and

converting the at least one selected prediction into:

a set of human-readable instructions comprising a test case document, and

a set of machine-readable instructions comprising an automation script.

19. The computer-implemented method of claim 18 , further comprising:

receiving user input specifying a validation point for addition to the at least one selected prediction, and adding the specified validation point to the at least one selected prediction.

20. The computer-implemented method of claim 18 , further comprising:

presenting to a user a validation point proposed for addition to the at least one selected prediction, wherein the validation point is presented at least in part based on a determination that a similar validation point was previously added by a second user.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 9, 2019
From: THANGAM, SATHIYANARAYANAN
To: SAP SE
Reel/Frame 049133/0606 →
Continuity (1)
Related Publication 20200356466A1 · Nov 12, 2020