Test case adjustment method and device, equipment and storage medium

By automatically identifying page elements and updating test cases, the problem of time-consuming and labor-intensive and error-prone problems in the existing technology of manual searching and maintenance of test cases is solved, and the adaptive page changes of test cases are realized, which reduces development time and error rate, and improves testing efficiency and stability.

CN119557220APending Publication Date: 2025-03-04CHINA POST INFORMATION TECH (BEIJING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411622998.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the prior art, when UI automation tests develop test case scripts, it is necessary to manually find and identify page elements in the browser debugging mode, analyze element attributes, and update them to test cases. This process is time-consuming and labor-intensive, and is prone to identification and analysis errors, resulting in test case execution failure or result deviations. Especially in large projects where pages change frequently, manual maintenance of test cases is expensive and cannot meet the needs of large-scale, frequent changes and complex testing.

Method used

By identifying the target page elements in the target page and determining its target element information; determining the reference test cases and reference element information corresponding to the target page; determining the information to be updated based on the target element information and reference element information, and adjusting the reference test cases based on this to generate the target test cases.

Benefits of technology

It realizes automatic discovery of page elements changes and adaptively adjusts test cases, so that test cases adapt to page changes, reduces script development time, reduces error rate, and improves testing efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557220A_ABST
    Figure CN119557220A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a test case adjustment method and device, equipment and a storage medium, and the method comprises the steps: recognizing at least one target page element in a target page, and determining the target element information of each target page element; determining a reference test case corresponding to the target page, and determining reference element information of each page element in the reference test case; and determining to-be-updated information according to the target element information and the reference element information, and adjusting the reference test case based on the to-be-updated information to obtain a target test case. According to the technical scheme of the embodiment of the invention, the problems of long script development time and high error rate due to the need of manually searching for the updating condition of the page element in the development process in the prior art are solved, the change condition of the page element can be automatically found, the test case can be adaptively adjusted, the test case is adaptive to the page change, and the test efficiency is improved. The script development time is shortened, the error rate is reduced, and the test efficiency and stability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of software testing technology, and in particular to a test case adjustment method, device, equipment and storage medium. Background Art

[0002] When developing test case scripts for UI automated testing, the process is time-consuming and labor-intensive. In the browser debugging mode, the required page elements are manually searched and identified one by one, the element attributes are analyzed, and the element attributes are copied to the test case. If there is an identification and analysis error due to human factors during the process, the wrong elements will cause the test case to fail or the results to deviate. When the page changes, the page elements may also change accordingly. The existing test case will fail when it is executed again. It is necessary to manually analyze which elements have changed and caused the case execution to fail based on the cause of the failure, search the page again, re-identify the element attributes, and update them to the test case. This maintenance method is costly. Especially in large projects, the manual method of finding and locating elements cannot meet the large-scale, frequently changing, and complex testing requirements. Summary of the invention

[0003] The embodiments of the present invention provide a test case adjustment method, apparatus, device and storage medium, which can automatically discover changes in page elements and adaptively adjust test cases, allowing test cases to adapt to page changes, reducing script development time, reducing error rates, and improving test efficiency and stability.

[0004] In a first aspect, an embodiment of the present invention provides a test case adjustment method, the method comprising:

[0005] Identify at least one target page element in a target page, and determine the target element information of each target page element; determine a reference test case corresponding to the target page, and determine the reference element information of each page element in the reference test case; determine the information to be updated based on the target element information and the reference element information, and adjust the reference test case based on the information to be updated to obtain a target test case.

[0006] In a second aspect, an embodiment of the present invention provides a test case adjustment device, the device comprising:

[0007] A target element information determination module is used to identify at least one target page element in a target page and determine the target element information of each target page element; a reference element information determination module is used to determine a reference test case corresponding to the target page and determine the reference element information of each page element in the reference test case; a test case adjustment module is used to determine the information to be updated based on the target element information and the reference element information, and adjust the reference test case based on the information to be updated to obtain a target test case.

[0008] In a third aspect, an embodiment of the present invention provides a computer device, the computer device comprising:

[0009] one or more processors;

[0010] A memory for storing one or more programs;

[0011] When the one or more programs are executed by the one or more processors, the one or more processors implement the test case adjustment method described in any embodiment.

[0012] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the test case adjustment method described in any embodiment.

[0013] The technical solution provided by the embodiment of the present invention identifies at least one target page element in the target page and determines the target element information of each target page element; determines the reference test case corresponding to the target page and determines the reference element information of each page element in the reference test case; determines the information to be updated according to the target element information and the reference element information, and adjusts the reference test case based on the information to be updated to obtain the target test case. The technical solution of the embodiment of the present invention solves the problem in the prior art that the update status of page elements needs to be manually searched during the development process, which is prone to long script development time and high error rate. It can automatically discover the changes of page elements and adaptively adjust test cases, so that test cases can adapt to page changes, reduce script development time, reduce error rate, and improve test efficiency and stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 is a flow chart of a test case adjustment method provided by an embodiment of the present invention;

[0015] Figure 2 It is a flow chart of another test case adjustment method provided by an embodiment of the present invention;

[0016] Figure 3A workflow diagram for adjusting a test case provided by an embodiment of the present invention;

[0017] Figure 4 It is a structural schematic diagram of a test case adjustment device provided by an embodiment of the present invention;

[0018] Figure 5 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] Figure 1 It is a flow chart of a test case adjustment method provided by an embodiment of the present invention. The embodiment of the present invention can be applied to the scenario of adjusting the test case corresponding to the page. The method can be executed by a test case adjustment device, which can be implemented by software and / or hardware.

[0021] like Figure 1 As shown, the test case adjustment method includes the following steps:

[0022] S110: Identify at least one target page element in a target page, and determine target element information of each target page element.

[0023] Among them, the target page may be a page that needs to be adjusted for test cases. Exemplarily, the target page may be a page obtained after manual revision. The technical solution of the embodiment of the present invention can automatically adjust the test case corresponding to the target page according to the target page. The target page element may be a page element in the target page that needs to be compared and contrasted. Exemplarily, in the absence of other requirements, all page elements in the target page can be identified, and the identified page elements are all used as target page elements. The target element information may be information about the identification attributes of the target page element. Exemplarily, the element information includes: at least one of an element tag, a text name, and an XML path.

[0024] S120: Determine a reference test case corresponding to the target page, and determine reference element information of each page element in the reference test case.

[0025] Among them, the reference test case can be a test case that needs to be adjusted corresponding to the target page. Exemplarily, in the case that the target page is a revised page, the test case corresponding to the page before revision can be used as a reference test case. In addition, the preset test case about the target page can also be used as a reference case. The reference element information can be the identification attribute information of the page element in the reference test case. Exemplarily, in the absence of other limiting requirements, each page element in the reference test case can be identified, and then the reference element information of each page element object can be determined separately. Before executing the test case corresponding to the target page, the technical solution of the embodiment of the present invention can compare the page elements in the target page with the page elements in the reference test case, automatically identify the page elements that need to be updated, and then complete the modification and adjustment of the test case.

[0026] S130: Determine information to be updated according to the target element information and the reference element information, and adjust the reference test case based on the information to be updated to obtain a target test case.

[0027] The information to be updated may be information that needs to be updated corresponding to the target page. Exemplarily, for each target page element, a reference page element corresponding to the target page element may be determined from a reference test case, and then the target element information of the target page element and the reference element information of the corresponding reference page element are compared. If the two are different, the reference page element in the reference test case is used as the information to be updated.

[0028] Furthermore, the target test case may be a test case obtained by updating the page element information in the reference test case. Exemplarily, for each sub-information to be updated in the reference test case, the sub-information to be updated may be adjusted to the target element information of the corresponding target page element, thereby implementing the update of the page element in the reference test case.

[0029] The technical solution provided by the embodiment of the present invention identifies at least one target page element in the target page and determines the target element information of each target page element; determines the reference test case corresponding to the target page and determines the reference element information of each page element in the reference test case; determines the information to be updated according to the target element information and the reference element information, and adjusts the reference test case based on the information to be updated to obtain the target test case. The technical solution of the embodiment of the present invention solves the problem in the prior art that the update status of page elements needs to be manually searched during the development process, which is prone to long script development time and high error rate. It can automatically discover the changes of page elements and adaptively adjust test cases, so that test cases can adapt to page changes, reduce script development time, reduce error rate, and improve test efficiency and stability.

[0030] Figure 2 It is another test case adjustment method flow chart provided by an embodiment of the present invention. The embodiment of the present invention can be applied to the scenario of adjusting the test case corresponding to the page. Based on the above embodiment, this embodiment further explains how to identify at least one target page element in the target page; and how to determine the information to be updated based on the target element information and the reference element information. The device can be implemented by software and / or hardware and integrated in a computer device with application development function.

[0031] like Figure 2 As shown, the test case adjustment method includes the following steps:

[0032] S210: Identify at least one target page element in a target page, and determine target element information of each of the target page elements.

[0033] Among them, the target page may be a page that needs to be adjusted for test cases. Exemplarily, the target page may be a page obtained after manual revision. The technical solution of the embodiment of the present invention can automatically adjust the test case corresponding to the page according to the target page. The target page element may be a page element in the target page that needs to be compared and contrasted. Exemplarily, in the absence of other requirements, all page elements in the target page can be identified, and the identified page elements are all used as target page elements. The target element information may be information about the identification attributes of the target page element. Exemplarily, the element information includes: at least one of an element tag, a text name, and an XML path.

[0034] Optionally, identifying at least one target page element in the target page includes: upon receiving an element identification instruction regarding the target page, determining at least one target element type according to the element identification instruction; identifying page elements in the target page that are the same element type as the target element type, and using the identified page elements as target page elements.

[0035] Among them, the element identification instruction can be an interactive instruction for specifying the element type to be identified. The target element type can be the element type to be identified in the target page. Specifically, the target element type can be manually specified and is not specifically limited here. Further, page elements of the same element type as the target element type in the target page can be identified, and the identified page elements can be used as target page elements.

[0036] S220: Determine a reference test case corresponding to the target page, and determine reference element information of each page element in the reference test case.

[0037] Among them, the reference test case can be a test case that needs to be adjusted corresponding to the target page. Exemplarily, in the case that the target page is a revised page, the test case corresponding to the page before revision can be used as a reference test case. In addition, the preset test case about the target page can also be used as a reference case. The reference element information can be the identification attribute information of the page element in the reference test case. Exemplarily, in the absence of other limiting requirements, each page element in the reference test case can be identified, and then the reference element information of each page element object can be determined separately. Before executing the test case corresponding to the target page, the technical solution of the embodiment of the present invention can compare the page elements in the target page with the page elements in the reference test case, automatically identify the page elements that need to be updated, and then complete the modification and adjustment of the test case.

[0038] S230: For each of the target page elements, determine a reference page element corresponding to the target page element from the reference test case.

[0039] The reference page element may be a page element for comparison with the target page element. Exemplarily, for each target page element, a page element with the same element tag as the target page element may be retrieved from the reference test case, and the retrieved page element may be used as a reference page element corresponding to the target page element.

[0040] S240: Compare the target element information of the target page element with the reference element information of the reference page element, and determine the sub-information to be updated corresponding to the target page element according to the comparison result.

[0041] The sub-information to be updated may be the information that needs to be updated corresponding to the target page element. Exemplarily, the element sub-information in the target page element information may be compared with the corresponding element sub-information in the reference element information. If any element sub-information of the target element information is different from that of the reference element information, the reference element information of the reference page element may be used as the sub-information to be updated. The element sub-information may be understood as a type of information in the page element information. For example, if the page element information includes multiple types of identification information, each type of identification information may be used as an element sub-information.

[0042] S250: Determine the information to be updated according to the sub-information to be updated of the target page elements, and adjust the reference test case based on the information to be updated to obtain a target test case.

[0043] The information to be updated may be information that needs to be updated corresponding to the target page. Exemplarily, the sub-information to be updated of multiple target page elements may be combined to obtain the information to be updated.

[0044] Optionally, the reference test case is adjusted based on the information to be updated to obtain the target test case, including: sending the information to be updated to a preset interactive interface, and obtaining an update confirmation instruction from the preset interactive interface; determining the target update information from the update information according to the update confirmation instruction, and adjusting the reference test case based on the target update information to obtain the target test case.

[0045] Among them, the preset interactive interface can be a preset interactive interface for test case management. By sending the information to be updated to the preset interactive interface, the user can review the information to be updated in the reference test case and issue a corresponding update confirmation instruction based on the review result. Among them, the update confirmation instruction can be a confirmation instruction for determining whether the information to be updated needs to be adjusted. Among them, the update confirmation instruction can include an adjustment instruction and a no-adjustment instruction. Exemplarily, the user can determine whether to adjust all the information to be updated as needed, and a corresponding no-adjustment instruction can be issued for the information to be updated that does not need to be adjusted, and a corresponding adjustment instruction can be issued for the information to be updated that needs to be adjusted.

[0046] Further, the target update information may be information that needs to be updated in the reference test application case. Exemplarily, based on the update confirmation instruction, the information to be updated that triggers the adjustment confirmation instruction may be used as the target update information, and then the reference test case may be adjusted based on the target update information to obtain the target test case.

[0047] Furthermore, the target test case may be a test case obtained by updating the page element information in the reference test case. Exemplarily, for each sub-information to be updated in the reference test case, the sub-information to be updated may be adjusted to the target element information of the corresponding target page element, thereby implementing the update of the page element in the reference test case.

[0048] Optionally, after obtaining the target test case, the adjustable items of the target test case may be displayed upon receiving a page editing instruction; interactive instructions regarding the adjustable items may be obtained, and the adjustable items may be edited based on the interactive instructions.

[0049] For example, in order to better understand the technical solution provided by the present invention, a specific embodiment is introduced below: For example, Figure 3 FIG. 1 is a workflow diagram for adjusting a test case provided by an embodiment of the present invention. Figure 3As shown in the figure, the workflow for adjusting the test case includes the following steps: implement the function operation through the graphical web interface, enter the target page information, obtain the page element information through Python's requests, lxml and other technologies in the back end, and clean the required element information according to certain rules, including element tags, text names, xpath paths, etc., and display it through the web page. The element information can be formatted and stored in the MySQL database after screening; at the same time, according to the text keywords of the obtained element information, match the pre-made test case steps in the system, and display them on the interface in the form of a form. If the expected results are not met, secondary editing and modification can be performed. Before the test case is executed, an element detection function is provided to retrieve the elements involved in the test case on the target page according to the element tag, text name and other information, compare the element information, and if there is inconsistency, mark the information and give options. The operator can choose to update the element information according to the needs to ensure the successful execution of the test case.

[0050] Specifically, you can adjust the test case by following the steps below:

[0051] Step 1: Add target page information

[0052] When creating a test case, the user enters the URL, user name, password, cookie and other information of the page being tested, as well as the text information of the target element. For example, if the page has an input box named "Mobile Number" and a button named "Query", enter the text information "Enter [Mobile Number], click [Query]". The target text information is not required.

[0053] Step 2: Get page element information

[0054] The front end passes the data to the back end code in the form of a form based on the URL of the tested page, the target element text and other information provided by the user. The back end uses technical modules such as requests and lxml to obtain page elements. After the acquisition is completed, the page element information result set will be displayed in the page list, including the label, text name, and XPATH path. If the target element text information is configured, the list will display the target element information. If not configured, all element information on the page will be displayed.

[0055] Step 3: Filter element information

[0056] Filter the required element information on the page. If the element information is incorrect, you can edit the element information, including the element tag, text name, xpath path, etc. After confirming the information, save it.

[0057] Step 4: Automatically fill in the test case form

[0058] When saving element information, call the automatic test case generation method to match the system pre-made operation steps according to the text name of the selected element information and the target text information filled in the first step. If the match is successful, the test case steps are generated and presented in the form of a page form. If the target text information is "Enter [mobile phone number]: 15XXXXXXX, click [Query]", and the element information text contains "mobile phone number, query", the test case steps are matched in the form of pre-made step label + text box, and the XPATH path of the target element is reversed in the text box, such as [Enter text] + XPATH path + 15XXXXXXX, [Click]: Query.

[0059] Step 5: Generate test cases

[0060] After the user confirms that the generated test case form data is correct, click Save to generate the test case.

[0061] Step 6: Review and edit the test case

[0062] By editing the test case and viewing the test case step form, if the automatically generated steps are inconsistent with the expectations, you can arrange the test case steps yourself. You can drag and drop the steps to sort them, modify the element attribute information in the steps, enter the content, XPATH path, etc.

[0063] In addition, the present invention provides an element detection function to sense in advance whether page elements have changed. Before the test case is executed, the element detection mechanism is triggered, the element detection module is called, and the tested page information is obtained through the requsts technology. The system searches the tested page information according to the text information and xpath based on the element information used by the current case, and displays the comparison results on the page. If there is any inconsistency, a prompt message is given. After the operator selects the required element information, it determines whether the element information needs to be updated or automatically updated. The test case is automatically updated after the element changes.

[0064] The present invention automatically locates and obtains page elements, and adapts to changes in page elements, thereby reducing the labor cost of traditional UI automation test script writing and maintenance, improving test accuracy, shortening the test cycle, and also improving test coverage because automatic positioning can quickly cover more pages. Systematic rapid automatic positioning to obtain page element information, adaptive page element adjustment, suitable for UI automation testing of graphical interfaces under B / S architecture, can not only make UI automation testing faster and more efficient, but also more effectively guarantee the quality of software delivery.

[0065] The technical solution provided by the embodiment of the present invention is to identify at least one target page element in the target page and determine the target element information of each target page element; determine the reference test case corresponding to the target page and determine the reference element information of each page element in the reference test case; for each target page element, determine the reference page element corresponding to the target page element from the reference test case; compare the target element information of the target page element with the reference element information of the reference page element, and determine the sub-information to be updated corresponding to the target page element according to the comparison result; determine the information to be updated according to the sub-information to be updated of multiple target page elements, and adjust the reference test case based on the information to be updated to obtain the target test case. The technical solution of the embodiment of the present invention solves the problem that the development process of the prior art requires manual search for the update of page elements, which is prone to long script development time and high error rate. It can automatically discover the changes of page elements and adaptively adjust test cases, so that test cases can adapt to page changes, reduce script development time, reduce error rate, and improve test efficiency and stability.

[0066] Figure 4 It is a structural schematic diagram of a test case adjustment device provided in an embodiment of the present invention. The embodiment of the present invention can be applied to the scenario of adjusting the test case corresponding to the page. The device can be implemented by software and / or hardware and integrated into a computer device with application development function.

[0067] like Figure 4 As shown, the test case adjustment device includes: a target element information determination module 310 , a reference element information determination module 320 and a test case adjustment module 330 .

[0068] Among them, the target element information determination module 310 is used to identify at least one target page element in the target page and determine the target element information of each target page element; the reference element information determination module 320 is used to determine the reference test case corresponding to the target page and determine the reference element information of each page element in the reference test case; the test case adjustment module 330 is used to determine the information to be updated according to the target element information and the reference element information, and adjust the reference test case based on the information to be updated to obtain the target test case.

[0069] The technical solution provided by the embodiment of the present invention identifies at least one target page element in the target page and determines the target element information of each target page element; determines the reference test case corresponding to the target page and determines the reference element information of each page element in the reference test case; determines the information to be updated according to the target element information and the reference element information, and adjusts the reference test case based on the information to be updated to obtain the target test case. The technical solution of the embodiment of the present invention solves the problem in the prior art that the update status of page elements needs to be manually searched during the development process, which is prone to long script development time and high error rate. It can automatically discover the changes of page elements and adaptively adjust test cases, so that test cases can adapt to page changes, reduce script development time, reduce error rate, and improve test efficiency and stability.

[0070] In an optional embodiment, the test case adjustment module 330 includes: an information to be updated determination unit, used to: for each of the target page elements, determine the reference page element corresponding to the target page element from the reference test case; compare the target element information of the target page element with the reference element information of the reference page element, and determine the sub-information to be updated corresponding to the target page element based on the comparison result; determine the information to be updated based on the sub-information to be updated of multiple target page elements.

[0071] In an optional embodiment, the information to be updated determining unit includes: an element information comparison subunit, used to: when the target element information is different from any element sub-information of the reference element information, use the reference element information of the reference page element as the sub-information to be updated.

[0072] In an optional embodiment, the target element information determination module 310 includes: a target page element determination unit, used to: upon receiving an element identification instruction regarding the target page, determine at least one target element type according to the element identification instruction; identify page elements in the target page that are the same element type as the target element type, and use the identified page elements as the target page elements.

[0073] In an optional embodiment, the test case adjustment module 330 includes: a test case confirmation unit, used to: send the information to be updated to a preset interactive interface, and obtain an update confirmation instruction from the preset interactive interface; determine the target update information from the update information according to the update confirmation instruction, and adjust the reference test case based on the target update information to obtain the target test case.

[0074] In an optional embodiment, the test case adjustment device also includes: a test case editing module, which is used to: display the adjustable items of the target test case when a page editing instruction is received; obtain interactive instructions about the adjustable items, and edit the adjustable items based on the interactive instructions.

[0075] In an optional implementation, the element information includes: at least one of an element tag, a text name, and an XML path.

[0076] The test case adjustment device provided in the embodiment of the present invention can execute the test case adjustment method provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.

[0077] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 5 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 5 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention. The computer device 12 can be any terminal device with computing capability and can be configured in the test case adjustment device.

[0078] like Figure 5 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0079] The bus 18 may be one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0080] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0081] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0082] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0083] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 20. Figure 5 As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0084] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing the test case adjustment method provided in the embodiment of the present invention, the method comprising:

[0085] Identify at least one target page element in a target page, and determine the target element information of each target page element; determine a reference test case corresponding to the target page, and determine the reference element information of each page element in the reference test case; determine the information to be updated based on the target element information and the reference element information, and adjust the reference test case based on the information to be updated to obtain a target test case.

[0086] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the test case adjustment method provided in any embodiment of the present invention is implemented, including:

[0087] Identify at least one target page element in a target page, and determine the target element information of each target page element; determine a reference test case corresponding to the target page, and determine the reference element information of each page element in the reference test case; determine the information to be updated based on the target element information and the reference element information, and adjust the reference test case based on the information to be updated to obtain a target test case.

[0088] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0089] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0090] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0091] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or combinations thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0092] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0093] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A test case adjustment method, characterized in that: include: Identifying at least one target page element in a target page, and determining target element information of each of the target page elements; Determine a reference test case corresponding to the target page, and determine reference element information of each page element in the reference test case; The information to be updated is determined according to the target element information and the reference element information, and the reference test case is adjusted based on the information to be updated to obtain the target test case.

2. The method according to claim 1, characterized in that The determining the information to be updated according to the target element information and the reference element information includes: For each of the target page elements, determining a reference page element corresponding to the target page element from the reference test case; Comparing the target element information of the target page element with the reference element information of the reference page element, and determining the sub-information to be updated corresponding to the target page element according to the comparison result; The information to be updated is determined according to the sub-information to be updated of the plurality of target page elements.

3. The method according to claim 2, characterized in that The determining the sub-information to be updated according to the comparison result includes: In the case that the target element information is different from any element sub-information of the reference element information, the reference element information of the reference page element is used as the sub-information to be updated.

4. The method according to claim 1, characterized in that The identifying at least one target page element in the target page includes: Upon receiving an element identification instruction regarding the target page, determining at least one target element type according to the element identification instruction; A page element of the target page having the same element type as the target element type is identified, and the identified page element is used as the target page element.

5. The method according to claim 1, characterized in that The step of adjusting the reference test case based on the information to be updated to obtain the target test case includes: Sending the information to be updated to a preset interactive interface, and obtaining an update confirmation instruction from the preset interactive interface; Target update information is determined from the update information according to the update confirmation instruction, and the reference test case is adjusted based on the target update information to obtain the target test case.

6. The method according to claim 1, characterized in that After obtaining the target test case, the method further includes: When receiving a page editing instruction, displaying adjustable items of the target test case; An interaction instruction regarding the adjustable item is obtained, and the adjustable item is edited based on the interaction instruction.

7. The method according to claim 1, characterized in that The element information includes: at least one of an element tag, a text name, and an XML path.

8. A test case adjustment device, characterized in that: The device comprises: A target element information determination module, used to identify at least one target page element in a target page, and determine target element information of each of the target page elements; A reference element information determination module, used to determine a reference test case corresponding to the target page, and to determine reference element information of each page element in the reference test case; The test case adjustment module is used to determine the information to be updated according to the target element information and the reference element information, and adjust the reference test case based on the information to be updated to obtain the target test case.

9. A computer device, characterized in that: The computer device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the test case adjustment method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the test case adjustment method as described in any one of claims 1 to 7 is implemented.