A WebUI automated testing method based on intelligent learning

Automatically generate WebUI automation test cases through intelligent learning methods, solving the problems of high cost of WebUI automation test development and high professional requirements, achieving ease of use and maintenance convenience, and adapting to page changes.

CN114297055BActive Publication Date: 2024-11-22WUHAN SIPU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111553559.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2024-11-22
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

WebUI automation test development costs are high and has high professional requirements for automation tests, which makes maintenance inconvenient.

Method used

Using an intelligent learning method, the user's functional module node information on the tested page is recorded, the navigation path and key node information are generated, and intelligent learning is carried out through multiple transmissions of values, and forward and reverse test cases and input specifications are automatically generated. Reduce programming operations and realize automated testing.

Benefits of technology

Reduces development costs, improves the ease of use and maintenance convenience of automated testing, and can automatically judge and adjust test cases to adapt to page changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114297055B_ABST
    Figure CN114297055B_ABST
Patent Text Reader

Abstract

The present application provides a WebUI automated testing method based on intelligent learning, including recording the node information of the functional module; generating the navigation path of the functional module and generating the key node information; transmitting the value to the item to be tested multiple times to perform the first stage of intelligent learning, and obtain the first test specification and the first test item; obtaining the label of the functional module according to the path to be learned, and storing the label in the item to be tested; traversing the items to be tested in sequence to perform the second stage of intelligent learning, and obtain the second test specification and the second test item; the second test item is different from the first test item; outputting the forward test case, the reverse test case and the input specification according to the first test specification, at least one first test item, the second test specification and at least one second test item. The present application can automatically generate the test results and test reports with only one simple page configuration operation, which solves the problem of high development cost and high professional requirements for WebUI automated testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to a WebUI automated testing method based on intelligent learning. Background Art

[0002] WebUI is the abbreviation of Website User Interface, which generally includes the interface design of common website designs such as e-commerce websites, social networking websites, network software such as email, and Saas (Software-as-a-Service, which means software as a service, that is, providing software services through the Internet) products. The difference between WebUI design and common website construction is that common website construction is designed with functions as the center, while WebUI pays more attention to the interaction and experience between people and websites, and is designed with people as the center. In order to ensure that the interfaces of these websites or network software can provide users with normal access or browsing functions, it is very important to test them.

[0003] Currently, WebUI automated testing mainly includes forward testing and reverse testing (also known as exception testing). In one implementation method, automated testing mainly relies on manually obtaining the specific code information of the current test page (html). For example, you first need to open the browser and start the developer tool, then select a specific input box, and then find the specific id or name or absolute path (xpath) of the input box to locate the element. After the element is located, the developer transfers the value of the input box separately, forms a test case based on the process and results of manual value transfer, and finally uses the test case to test the system to generate test results and test reports. However, the above operations require high professional skills, are very time-consuming, and have very high development costs.

[0004] In addition, when conducting reverse testing (abnormal testing), a simple input box may have 10 abnormal test points. These abnormal test points require R&D personnel to manually develop abnormal test cases based on the current page function. The workload may be several times that of positive testing. When other configuration items are added or other elements are modified on the test page, subsequent maintenance work is also very difficult. In summary, the current development cost of WebUI automated testing is very high and the requirements for automated testing expertise are very high, and maintenance is inconvenient. Summary of the invention

[0005] The present application provides a WebUI automated testing method based on intelligent learning to solve the current problems of high development cost of WebUI automated testing, high requirements for automated testing expertise, and inconvenient maintenance.

[0006] A WebUI automated testing method based on intelligent learning, comprising:

[0007] A WebUI automated testing method based on intelligent learning, comprising:

[0008] Recording the node information of all functional modules clicked by the user on the tested page, wherein the node information is a collection of corresponding operations in all the functional modules;

[0009] Generate a navigation path of a function module of the page under test according to the node information, and generate key node information according to the node information, wherein the key node information is a set of items to be tested in the page under test, and the items to be tested are one or more function modules to be tested in the page under test;

[0010] Storing a plurality of the functional module navigation paths to form a path to be learned;

[0011] Storing a plurality of key node information to form a node item to be learned;

[0012] According to the node item to be learned, multiple values ​​are transmitted to the item to be tested to perform first-stage intelligent learning, so as to obtain a first test specification and a first test item;

[0013] Acquire a label of a functional module according to the path to be learned, and store the label in the item to be tested; traverse the items to be tested in sequence to perform second-stage intelligent learning to obtain a second test specification and a second test item; the second test item is different from the first test item;

[0014] A forward test case, a reverse test case and an input specification are output according to the first test specification, at least one of the first test items, the second test specification and at least one of the second test items.

[0015] Further, according to the node item to be learned, multiple values ​​are transmitted to the item to be tested to perform first-stage intelligent learning, and a first test specification and a first test item are obtained, including:

[0016] Combining the node item to be learned with the item to be tested, and inputting the combination to obtain a process value;

[0017] comparing the process value with a preset expected value;

[0018] If the process value matches the expected value, automatically generating the first test specification and the first test item;

[0019] If the process value does not match the expected value, the combination input is reduced and the process value is recalculated until all combinations complete the first stage of intelligent learning.

[0020] Further, outputting a forward test case, a reverse test case and an input specification according to the first test specification, the first test item, the second test specification and the second test item includes:

[0021] Performing an AND operation on the first test item and the second test item to obtain a first test set and a second test set; the first test set is an intersection of the first test item and the second test item, and the second test set is a set of data outside the intersection;

[0022] Generate input specifications according to preset rules and algorithms, the first test specifications, and the second test specifications;

[0023] Testing the first test set according to the input specification to generate a process test result;

[0024] If the process test result is consistent with the preset expected test result, output a positive test case;

[0025] If the process test result is inconsistent with the preset expected test result, output a reverse test case and track the reverse test case;

[0026] The second stage intelligent learning is performed on the second test set, and the learning result is recorded.

[0027] Further, generating a functional module navigation path of the tested page according to the node information, and generating key node information according to the node information, includes:

[0028] Capturing the functional module navigation path, where the functional module navigation path is obtained by analyzing the node information and the tested module in the tested page;

[0029] The function module navigation path is obtained to obtain the tested operation, and the tested operation is recorded to analyze the key node information and function point information of the tested module, so as to locate the function module navigation path through the key node information and the function point information; the function point information is a collection of operability components.

[0030] Furthermore, the WebUI automated testing method based on intelligent learning also includes:

[0031] A WebUI automated test script is generated, wherein the WebUI automated test script is obtained by analyzing the user operation and the key node information.

[0032] Furthermore, the WebUI automated testing method based on intelligent learning also includes: analyzing the key node information to locate the target test point.

[0033] Further, positioning the target test point according to the key node information includes:

[0034] The key node information includes type, id number, and input value;

[0035] Read the key node information to obtain the type;

[0036] The type and the ID number are analyzed to locate the target test point.

[0037] Furthermore, before enabling the WebUI monitoring function, the following steps are also included:

[0038] Submit the functional configuration items of the browser and the page being tested. After submission, click Auto Position to start WebUI automated testing.

[0039] Furthermore, before performing the first stage intelligent learning and the second stage intelligent learning, it also includes: judging the consistency between the automated test results and the manual test results, and if they are consistent, automatically generating an automated execution script.

[0040] Furthermore, the WebUI automated testing method based on intelligent learning also includes: inputting the forward test case, the reverse test case and the input specification into the tested page to generate an intelligent learning automated testing script.

[0041] It can be seen from the above technical scheme that the present application provides a WebUI automated testing method based on intelligent learning, including recording the node information of all functional modules clicked by the user on the tested page; generating a functional module navigation path of the tested page according to the node information, and generating key node information according to the node information; storing multiple functional module navigation paths to form a path to be learned; storing multiple key node information to form a node item to be learned; transferring values ​​to the item to be tested multiple times according to the node item to be learned to perform a first-stage intelligent learning, and obtain a first test specification and a first test item; obtaining a label of the functional module according to the path to be learned, and storing the label in the item to be tested; traversing the items to be tested in sequence to perform a second-stage intelligent learning, and obtain a second test specification and a second test item; the second test item is different from the first test item; outputting a forward test case, a reverse test case and an input specification according to the first test specification, at least one first test item, a second test specification and at least one second test item. This application can automatically generate test results and test reports with just one simple page configuration operation, solving the current problem of high development costs and high requirements for automated testing expertise in WebUI automated testing. When the function page of the tested page changes, this application method can also automatically determine and automatically adjust the test case, solving the current problem of inconvenient maintenance of WebUI automated testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 A logical diagram of a WebUI automated testing method based on intelligent learning provided in an embodiment of the present application;

[0044] Figure 2 A logical relationship diagram of two stages of intelligent learning provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application. The technical solutions provided by the embodiments of the present application are described in detail below in conjunction with the drawings.

[0046] In order to solve the current problems of high development cost of WebUI automated testing, high requirements for automated testing expertise, and inconvenient maintenance, the present application embodiment provides a WebUI automated testing method based on intelligent learning, which specifically includes the following contents:

[0047] Record the node information of all functional modules that the user has clicked on the tested page. Before recording the node information of all functional modules that the user has clicked on the tested page, it also includes turning on the WebUI monitoring function and obtaining the tested page. After the user logs in to the tested page, some click operations will be performed, where the node information is a collection of corresponding operations in all functional modules. In an embodiment of the present application, when implementing the test, the tester does not need to perform any programming operations. He only needs to open the browser, log in to the tested page correctly, click on the functional page to be tested, submit the functional configuration items of the browser and the tested page, and click automatic positioning after submission to start WebUI automated testing.

[0048] After the node information of all function modules clicked by the user on the tested page is recorded, the function module navigation path of the tested page is generated according to the node information, and the key node information is generated according to the node information. Among them, the key node information is a collection of items to be tested in the tested page, and the items to be tested are one or more function modules to be tested in the tested page.

[0049] In some embodiments, generating a function module navigation path of a tested page according to node information, and generating key node information according to node information may include the following steps: capturing the function module navigation path, the function module navigation path is obtained by analyzing the node information and the tested module in the tested page; acquiring the function module navigation path to obtain the tested operation, and recording the tested operation to analyze the key node information and function point information of the tested module, so as to locate the function module navigation path through the key node information and function point information. The function point information is a collection of operability components.

[0050] In order to facilitate further understanding of the above steps, the detailed operation process of the above steps is illustrated below with reference to the accompanying drawings and specific examples.

[0051] See also Figure 1 , Figure 1 The logical diagram of the WebUI automated testing method based on intelligent learning provided by the embodiment of the present application, when starting the automatic test, first turn on the WebUI monitoring function to capture the user operation content. For example, the tested page accessed in the browser input bar can be captured by the Request URL method, and the tested page entered in the browser, that is, the user access address, can be recorded.

[0052] After obtaining the page that the user is going to test, i.e. the page to be tested, the user clicks on the function page to be tested, and the node information and function point information of the page navigation link clicked by the user can be captured. For example, the first-level menu is: <a href="javascript:;"id="menu2"target="main_content"onclick="tree_content_control(2,2,this)"> Policy Configuration ; The secondary menu is <a id="sd10"class="nodesel"href="?g=sec_session_limit_show"title="策略配置> Session Control Management"target="Main_content"onclick="javascript:ds(10);">Session Control Management ; According to the user's click operation, the key information of the node of the page navigation link, such as id, title and tree structure relationship, can be obtained, leaving the operation path for the subsequent automatic learning, so that the path of the tested module can be obtained.

[0053] After obtaining the path of the module under test, capture the user's functional operation. For example, take the example of clicking the new operation. After clicking the new operation, configure it and then click Submit. The node information of the current operation module path is also obtained based on the key node information of the page. For example, the operation statement can be <input type="text"name="limit_name"id="count_cid"class="input middle"value=""> Data can be entered in the text input box. Although the type of the object being operated is not known initially, it can be autonomously learned through key node information such as type, id, and value, and the data transmitted to the current object is obtained through user operations.

[0054] In some embodiments, after obtaining the tested page, tested module (function point information), and user operation through the above steps, key node information can be captured through the user's operation, and then the user operation and key node information can be analyzed, and WebUI automated test cases can be automatically generated, which is convenient for users to use directly. A test case refers to a description of a test task for a specific software product, reflecting the test plan, method, technology, and strategy. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document. Simply put, a test case is a set of test inputs, execution conditions, and expected results compiled for a special goal, which is used to verify whether a specific software requirement is met. The test cases and scripts automatically generated for this link are not specifically limited in this application. For example, automatic learning may not be performed, and it can be determined according to actual conditions and needs.

[0055] In other embodiments, based on the above-mentioned automated test cases, the automated test results generated by the automated test cases can also be compared with the results of manual tests. If the automated test results are consistent with the manual test results, proving that the execution is correct, an automated execution script can be automatically generated according to pre-set rules.

[0056] When locating the navigation path of the functional module through key node information and function point information, for example, in the actual operation process, the operation-related process is recorded as follows: "Address address = tested page; open the browser, visit the tested page: driver.get (address address); click the navigation link: generate a click script through the recorded names and titles of the first-level and second-level menus". Through the above operations, according to the key node information in the tested page, the test system obtains the type in text format, that is, the navigation path of the functional module can be located through the key node information and function point information.

[0057] In some embodiments, the present application can also locate the target test point according to the key node information. The target test point can be any item to be tested in the module under test, and locating the target test point according to the key node information can be achieved in the following ways: if the key node information can include type, ID number, input value, read the key node information to obtain the type; analyze the type and ID number to locate the target test point.

[0058] The existing WebUI automatic screen recording is just a simple screen recording, which cannot adapt to other displays. Other testers cannot use the recorded script on their own computers, resulting in poor usability. When the tested device changes version, the script will no longer be usable. The method of the embodiment of the present application uses the key node information of the tested page for positioning operations, which fundamentally solves this problem. No matter how the page size changes, any tester can use any size of display, or change the test version of another user, and can accurately operate the key node information for automated testing, which effectively enhances the usability of automated testing and reduces the maintenance operation of automated testing.

[0059] After generating the functional module navigation path of the tested page according to the node information and generating the key node information according to the node information, the multiple functional module navigation paths are stored to form a path to be learned; and the multiple key node information are stored to form a node item to be learned. Specifically, after recording the node information of all functional modules clicked by the user on the tested page, the navigation path of the current tested module can be captured, and the navigation path of the tested module is stored to form a path to be learned. At the same time, the key node information of the tested page is also stored to form a node item to be learned.

[0060] For example, in some embodiments, the navigation path of the module to be tested is "Policy Configuration-Object Management-Address Object", and the embodiment of the present application can automatically generate a link to the navigation path according to the name or title of the first-level, second-level, and third-level menus and store it in the path to be learned (such as the path to be learned is Wait_Navigation). For another example, the operation of the module to be tested can be "Click New-Fill in Name-Fill in Description-Fill in IP Address-Fill in Excluded IP Address-Click Submit", and a way to form a node item to be learned can be to store the button title in "Click New" in the node item to be learned (such as the node item to be learned is Wait_Option), and store the name, description, IP address, and name, id, and type of the excluded IP address in the node item to be learned (such as Wait_Name, Wait_Desc, Wait_IP, Wait_exclude_IP).

[0061] After the path to be learned and the node to be learned are generated, the page of the module to be tested can be found by using the path to be learned (Wait_Navigation), and the page of the newly created address object can be opened by clicking the new operation according to the node to be learned (Wait_Option). Then the intelligent learning stage can be carried out.

[0062] In the embodiment of the present application, intelligent learning is divided into two learning stages, namely first-stage intelligent learning and second-stage intelligent learning. The two stages of learning are now introduced respectively.

[0063] The first stage of intelligent learning: According to the node items to be learned, multiple values ​​are transmitted to the items to be tested to perform the first stage of intelligent learning, and the first test specifications and the first test items are obtained. The first stage of intelligent learning can be performed through the following steps: Combined input is performed to the items to be tested in combination with the node items to be learned to obtain the process value; the process value is compared with the preset expected value; if the process value matches the expected value, the first test specification and the first test item are automatically generated; if the process value does not match the expected value, the combination input is reduced, and the process value is recalculated until all combinations complete the first stage of intelligent learning.

[0064] Specifically, the first stage of intelligent learning can also be called deep learning, and the key node information is a set of items to be tested in the tested page. After recording the page where the tested module is located, you can jump directly to the tested page. During the user's operation, the method of the embodiment of the present application can automatically obtain all the operation boxes of the current page, and can take the intersection with the function-related operations of the items to be tested pre-set by the tested module, and combine the node items to be learned to input the items to be tested in combination to obtain the process value. For example, for a text box object, a variety of combined inputs (forward input, reverse input), etc. can be performed to obtain the process value, and the process value is compared with the calculated expected value to see if it matches, and it is determined whether the test result of the current input box meets expectations. If it meets expectations, the first test specification and the first test item are automatically generated. If it does not meet expectations, the combined input method is reduced and recalculated until all combinations are completed with learning.

[0065] In the first stage of intelligent learning (deep learning), the data in the node items to be learned are intelligently learned one by one. The Wait_Name data in the node items to be learned can contain the following information: the name of the item to be tested (name), the input box type (text), and the input box ID (id). In the actual operation scenario, the position of the current input box can be found according to the input box ID (id) (such as element_by_id (id)), and the input box type (text) can be determined as input text data. If the type of the operation box is check or combox, it will automatically determine whether to use the input operation or select the check operation. After determining the type and ID, you can pass values ​​to the item to be tested (such as numbers, letters, Chinese characters, special characters, and input box length limits).

[0066] In one implementation, the above process can be implemented in the following manner, for example:

[0067] 1. Enter 32 characters in the operation box and click Submit. The page prompts that the input information is wrong. The capture pop-up box content is failure (judged according to the icon of the pop-up box (warning icon, pass icon)). Record this operation in the reverse test case and enter BUG (A);

[0068] 2. Enter random special characters (!@#) in the operation box and click Submit. The page prompts that illegal characters have been entered. Capture the pop-up content as a failure. Record this operation in the reverse test case, such as BUG (A, B);

[0069] 3. Enter 62 characters in the operation box and click Submit. The page prompts that the input information is too long. Capturing the pop-up box content is a failure. Record this operation in the reverse test case, such as BUG (A, B, C), and retest the input box length according to the binary method (divide the input data length this time by 2 and perform the next test);

[0070] 4. Enter 31 numbers in the operation box 1. Click Submit. The page prompts that the operation is successful. The pop-up box content is captured as successful. The lateral operation record is recorded in the forward test case, such as PASS (A);

[0071] Based on the above multiple attempts to input and the content of the pop-up box, the first test specification and the first test item can be learned intelligently. Through deep learning, the first test specification such as type can be determined, the value range can be determined, and the input length can be determined (for example, the specification Capacity of the current item to be tested allows the input of numbers and letters, the length specification is 31, and no special characters and Chinese characters are allowed), and the first test items of all tested modules (such as input boxes, check boxes, radio buttons, etc.) of the current tested page can be obtained, such as the forward test case data PASS list and the reverse test case BUG list.

[0072] In some embodiments, the first test specification tested can also be associated with the tested module of the tested page, so that in subsequent tests, if a tested module of type text is encountered again, the current learning result can be used first to reduce the time for re-learning. At the same time, it can also be stipulated in advance according to actual needs that the current learning result must be used when a tested module with name as a name is encountered again. If the specifications are inconsistent, it is a bug discovered by the test (the input box specifications are not uniform).

[0073] In the first stage of intelligent learning, by performing intelligent learning on the data in the learning node items one by one, the first test specifications and the first test items of the items to be tested in each tested module in the key node information can be obtained. For example, the value transmission range, input length, related test specifications, etc. of each tested module can be obtained through the first stage of intelligent learning. After the first stage of intelligent learning is completed, the second stage of intelligent learning can be continued.

[0074] The second stage of intelligent learning: obtain the label of the functional module according to the path to be learned, and store the label in the item to be tested; traverse the items to be tested in sequence to perform the second stage of intelligent learning, and obtain the second test specification and the second test item, which is different from the first test item. The second stage of intelligent learning can also be called extended learning, which is mainly based on the first stage of intelligent learning, and performs extended learning on the items to be tested of the tested module.

[0075] For example, use the path to be learned (such as Wait_Navigation) to find the page of the module to be tested. According to the information of the node item to be learned (Wait_Option), such as "the name is new, the absolute path location is: / / *[@id="toolbar_obj_address"] / div / a[1] / span / span[1]", according to the location of the absolute path, it can be known that there are multiple groups of tags in the upper layer (the tag annotation format can be div / with a mark below). After that, all tags under div are automatically obtained to prepare for the second stage of intelligent learning, namely extended learning.

[0076] In some embodiments, extended learning can be performed by acquiring other operable buttons, mainly learning operations such as creating, editing, querying, and deleting. In the extended learning stage, functional buttons are automatically captured, such as automatically acquiring all functional buttons (add, edit, query, delete, etc.) and operable links of the tested page, and clicking them one by one. For example, the corresponding operations can be:

[0077] / / *[@id="toolbar_obj_address"] / div / a[1] / span / span[1]: Create a new button;

[0078] / / *[@id="toolbar_obj_address"] / div / a[2] / span / span[1]: edit button;

[0079] / / *[@id="toolbar_obj_address"] / div / a[3] / span / span[1]: query button";

[0080] …

[0081] / / *[@id="toolbar_obj_address"] / div / a[x] / span / span[1]: other operation buttons;

[0082] The tags obtained above are stored in the items to be tested, such as (Wait_text(New, Edit, View, XXXX)), and the items to be tested in Wait_text are traversed in turn to perform extended intelligent learning. After each function button is clicked, the automatic learning will determine whether a new operable page or prompt information pops up, and obtain key nodes (text / combox / check / input / button) and other information on the operable page. Multiple combinations of automatic input operations can be performed on the newly captured key node information. For other key nodes, the extended learning will learn one by one according to different types of nodes.

[0083] For example, in one implementation, after obtaining the query button, first obtain all the form data of the current page, then click the query button, a query box pops up, captures the key nodes in the query box (text type), determines the node type (text type), tries to enter one of the data in the form data, clicks the key node information (button / submit / confirm / query), obtains all the data of the current page, and checks whether it meets expectations (whether data_name is equal to the input information). If it meets expectations, the form data just obtained is the content data, and multiple combinations are input (forward input, reverse input). If it does not meet expectations, reselect the form data for input. At the same time, the operation that successfully learns the expected results can also automatically generate WebUI automated test cases. In other words, in the process of extended learning, the operational information of the tested page can be captured by some judgments on the page.

[0084] In the second stage of intelligent learning, all operable items of all items to be tested (such as new creation, editing, deletion, query) in the current page being tested can be extended and tested in turn, and when an input box is added or reduced, the page being tested can be automatically analyzed to know whether the current page has changed. At the same time, combined with the deep test of the first stage of intelligent learning, it can be known whether the input box content restriction has been modified, that is, when the page is modified, it will automatically judge and modify its own test case, greatly reducing the time cost of maintenance and positioning modification, without the need for R&D personnel to invest, only need to re-execute the test. Thus, the embodiment of the present application solves the problem that in the existing WebUI automation development, each function point (such as addition, deletion, modification, and query) requires developers to program and the workload doubles. The WebUI automation testing method of intelligent learning provided by the embodiment of the present application will realize WebUI automation intelligent learning, and output related forward and reverse test execution scripts, solving the problems of high development cost and inconvenient maintenance.

[0085] At the same time, the intelligent automated learning in the embodiments of the present application, from script recording to intelligent learning, does not require testers to have a high level of technical skills, and can automatically generate test cases, thereby solving the current defects of high development costs, inconvenient maintenance, and relatively high requirements for automated testing expertise in automated testing.

[0086] After the two stages of intelligent learning are completed, the test data of the intelligent learning is compared with the expected results, including outputting positive test cases, reverse test cases and input specifications according to the first test specification, at least one first test item (there may be multiple first test items in the actual learning process), the second test specification and at least one second test item (there may also be multiple second test items in the actual learning process). Specifically, the positive test cases, reverse test cases and input specifications can be output through the following steps: performing an AND operation on the first test item and the second test item to obtain a first test set and a second test set; the first test set is the intersection of the first test item and the second test item, and the second test set is the set of data outside the intersection; generating input specifications according to preset rules and algorithms, the first test specifications and the second test specifications; testing the first test set according to the input specifications to generate process test results; if the process test results are consistent with the preset expected test results, outputting positive test cases; if the process test results are inconsistent with the preset expected test results, outputting reverse test cases and tracking the reverse test cases; performing the second stage of intelligent learning on the second test set, and recording the learning results.

[0087] In some embodiments, the first test specification and the first test item are obtained in the first stage of intelligent learning, and the second test specification and the first test item are obtained in the second stage of intelligent learning. The test items in the two stages of intelligent learning can be ANDed. If the same items to be tested (i.e., the first test set) are obtained, such as name, description, IP, excluded IP, etc., the same items to be tested are tested using the input specifications.

[0088] In actual test scenarios, some test rules can be prepared in advance. For example, if the two stages of intelligent learning have the same test items, the intelligent test results (such as input specifications) can be used for testing first. If the test results are inconsistent, it is a software defect BUG, ​​and the order can be tracked according to the actual situation. Figure 1 If there are different test items in the second stage of intelligent learning, continue deep learning (first stage of intelligent learning) and record the results of intelligent learning. Figure 2 That is to say, in the actual process of intelligent learning, the first stage of intelligent learning is carried out first, and then the second stage of intelligent learning is carried out on the basis of the first stage of intelligent learning; and in the second stage of intelligent learning, the first stage of intelligent learning is included, and the two stages of intelligent learning complement each other.

[0089] After the forward test cases, reverse test cases and input specifications are generated, the embodiment of the present application also includes testing the tested page according to the forward test cases, reverse test cases and input specifications, and generating test results and test reports. The forward test cases, reverse test cases and input specifications are input into the tested page to generate an intelligent learning automated test script.

[0090] Specifically, through the deep learning of the first stage of intelligent learning, the user's operation steps in the actual test can be fully simulated, which solves the defect of very high time cost in the existing WebUI automation development (the existing forward test and reverse test must be written manually, and when a test page has more than a dozen or dozens of input boxes, the workload is very large). Combining the first stage of intelligent learning and the second stage of intelligent learning, the forward test list and the reverse test list (abnormal test) and input specifications are obtained by calculation, and a complete test case is automatically generated, and a test combination and test report are generated. In this way, the development cost of R&D members can be greatly reduced, and the time for writing use cases later can be greatly reduced by learning the input specifications. For example, when writing address group objects and service objects, some test items can completely reuse the test cases and specifications learned this time, thereby effectively reducing the workload of R&D members.

[0091] The present application provides a WebUI automated testing method based on intelligent learning, comprising recording node information of all functional modules clicked by a user on a tested page; generating a functional module navigation path of the tested page according to the node information, and generating key node information according to the node information; storing multiple functional module navigation paths to form a path to be learned; storing multiple key node information to form a node item to be learned; performing a first-stage intelligent learning by transferring values ​​to a to-be-tested item multiple times according to the node item to be learned, and obtaining a first test specification and a first test item; obtaining a label of the functional module according to the path to be learned, and storing the label in the to-be-tested item; traversing the to-be-tested items in sequence to perform a second-stage intelligent learning, and obtaining a second test specification and a second test item; the second test item is different from the first test item; and outputting a forward test case, a reverse test case and an input specification according to the first test specification, at least one first test item, a second test specification and at least one second test item. This application can automatically generate test results and test reports with just one simple page configuration operation, solving the current problem of high development costs and high requirements for automated testing expertise in WebUI automated testing. When the function page of the tested page changes, this application method can also automatically determine and automatically adjust the test case, solving the current problem of inconvenient maintenance of WebUI automated testing.

[0092] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art that are not disclosed in the present invention.

[0093] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A WebUI automated testing method based on intelligent learning, characterized in that: include: Recording the node information of all functional modules clicked by the user on the tested page, wherein the node information is a collection of corresponding operations in all the functional modules; Generate a navigation path of a function module of the page under test according to the node information, and generate key node information according to the node information, wherein the key node information is a set of items to be tested in the page under test, and the items to be tested are one or more function modules to be tested in the page under test; The generating of the function module navigation path of the tested page according to the node information, and the generating of the key node information according to the node information, comprises: capturing the function module navigation path, wherein the function module navigation path is obtained by analyzing the node information and the tested module in the tested page; acquiring the function module navigation path to obtain the tested operation, and recording the tested operation to analyze the key node information and the function point information of the tested module, so as to locate the function module navigation path through the key node information and the function point information; the function point information is a collection of operability components; Storing a plurality of the functional module navigation paths to form a path to be learned; Storing a plurality of key node information to form a node item to be learned; According to the node item to be learned, multiple values ​​are transmitted to the item to be tested to perform first-stage intelligent learning, so as to obtain a first test specification and a first test item; The method of performing multiple value transmissions to the item to be tested according to the node item to be learned to perform the first stage of intelligent learning to obtain the first test specification and the first test item includes: performing combined input to the item to be tested in combination with the node item to be learned to obtain a process value; comparing the process value with a preset expected value; if the process value matches the expected value, automatically generating the first test specification and the first test item; if the process value does not match the expected value, reducing the combined input and recalculating the process value until all combinations complete the first stage of intelligent learning; Acquire a label of a functional module according to the path to be learned, and store the label in the item to be tested; traverse the items to be tested in sequence to perform second-stage intelligent learning to obtain a second test specification and a second test item; the second test item is different from the first test item; A forward test case, a reverse test case and an input specification are output according to the first test specification, at least one of the first test items, the second test specification and at least one of the second test items.

2. The WebUI automated testing method based on intelligent learning according to claim 1 is characterized in that: Outputting a forward test case, a reverse test case and an input specification according to the first test specification, the first test item, the second test specification and the second test item includes: Performing an AND operation on the first test item and the second test item to obtain a first test set and a second test set; the first test set is an intersection of the first test item and the second test item, and the second test set is a set of data outside the intersection; Generate input specifications according to preset rules and algorithms, the first test specifications, and the second test specifications; Testing the first test set according to the input specification to generate a process test result; If the process test result is consistent with the preset expected test result, output a positive test case; If the process test result is inconsistent with the preset expected test result, output a reverse test case and track the reverse test case; The second stage intelligent learning is performed on the second test set, and the learning result is recorded.

3. The WebUI automated testing method based on intelligent learning according to claim 1 is characterized in that: Also includes: A WebUI automated test script is generated, wherein the WebUI automated test script is obtained by analyzing the user operation and the key node information.

4. The WebUI automated testing method based on intelligent learning according to claim 1, characterized in that: Also includes: The key node information is analyzed to locate the target test point.

5. The WebUI automated testing method based on intelligent learning according to claim 4 is characterized in that: Positioning the target test point according to the key node information includes: The key node information includes type, id number, and input value; Read the key node information to obtain the type; The type and the ID number are analyzed to locate the target test point.

6. The WebUI automated testing method based on intelligent learning according to claim 1 is characterized in that: Before enabling the WebUI monitoring function, the following are also required: Submit the functional configuration items of the browser and the page being tested. After submission, click Auto Position to start WebUI automated testing.

7. The WebUI automated testing method based on intelligent learning according to claim 1 is characterized in that: Before performing the first stage intelligent learning and the second stage intelligent learning, it also includes: judging the consistency between the automated test results and the manual test results, and if they are consistent, automatically generating an automated execution script.

8. The WebUI automated testing method based on intelligent learning according to claim 1, characterized in that: Also includes: The forward test case, the reverse test case and the input specification are input into the tested page to generate an intelligent learning automated test script.