Test processing method, device, computer equipment, readable storage medium and program product
By acquiring interface data traffic information and page control metadata, and using metadata interface call rules to automatically create test cases, the problem of low efficiency in traditional testing processes is solved, achieving rapid and efficient test case generation and saving manpower costs.
Patent Information
- Application Number
- CN202411951045.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2044-12-27
AI Technical Summary
Traditional testing methods are inefficient, time-consuming, and have high labor costs.
By acquiring interface data traffic information, page metadata, and control metadata, test cases can be automatically created using metadata interface call rules, reducing manual intervention.
It enables rapid and automated creation of test cases, improves test processing efficiency, saves labor costs, and increases the coverage of automated test cases.
Smart Images

Figure CN119759785B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a test processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] During software development, testing teams often face a series of challenges, such as the recurrence of fixed defects, cascading defects caused by version incompatibility, and issues where system monitoring appears normal initially after deployment but users report defects. These problems require testers to manually create test cases for testing. However, traditional testing methods are often time-consuming and inefficient. Summary of the Invention
[0003] Therefore, it is necessary to provide a test processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve efficiency in response to the above-mentioned technical problems.
[0004] Firstly, this application provides a test processing method, including:
[0005] In response to a test case creation request, obtain the interface data traffic information corresponding to the creation request;
[0006] Based on the interface data traffic information, obtain the page metadata of the corresponding interface;
[0007] Obtain the control metadata of the controls in the page to which the page metadata belongs, and obtain the corresponding test platform component based on the control metadata; the test platform component includes metadata interface call rules;
[0008] According to the metadata interface call rules, obtain the target control metadata corresponding to the current interface operation from the control metadata;
[0009] Based on the interface data traffic information and the target control metadata, create test cases by following these steps.
[0010] In one embodiment, the step of obtaining the interface data traffic information corresponding to the creation request in response to the test case creation request includes:
[0011] In response to a test case creation request, obtain the test case code from the creation request;
[0012] The set of interface data traffic information required for the use case encoding is queried to obtain the interface data traffic information corresponding to the creation request; the set of interface data traffic information includes at least one interface data traffic information.
[0013] In one embodiment, obtaining the target control metadata corresponding to the current interface operation from the control metadata according to the metadata interface call rules includes:
[0014] Obtain the operation identifier and request parameters of the current interface operation from the interface data traffic information, and determine the operation type based on the operation identifier;
[0015] Based on the operation type and the structure of the request parameters, determine the metadata type, and according to the metadata interface calling rules, determine the target control identifier corresponding to the metadata type from the request parameters;
[0016] Obtain the target control metadata corresponding to the target control identifier from the control metadata.
[0017] In one embodiment, the step of creating test cases based on the interface data traffic information and the target control metadata includes:
[0018] Based on the target control identifier and the request parameters, obtain the control interface parameter values of the interface call control;
[0019] Determine the request steps that match the operation type;
[0020] The target page parameter values are determined based on the target control identifier and the control interface parameter values;
[0021] Following the request steps, the steps to create test cases are as follows: based on the operation type, the target control identifier, and the target page parameter values.
[0022] In one embodiment, determining the target page parameter value based on the target control identifier and the control interface parameter value includes:
[0023] Obtain the mapping relationship between interface parameter values and page parameter values from the target control metadata;
[0024] The target page parameter value is determined from the mapping relationship based on the target control identifier and the control interface parameter value.
[0025] In one embodiment, prior to responding to the test case creation request, the method further includes:
[0026] Obtain the metadata interface call rules and encapsulate the metadata interface call rules into a test platform component;
[0027] The interface data traffic information is obtained through a browser plugin.
[0028] Secondly, this application also provides a test processing apparatus, comprising:
[0029] The interface data traffic information acquisition module is used to acquire the interface data traffic information corresponding to the creation request in response to the test case creation request.
[0030] The page metadata acquisition module is used to acquire the page metadata of the corresponding interface based on the interface data traffic information.
[0031] The control metadata acquisition module is used to obtain the control metadata of the controls in the page to which the page metadata belongs, and to obtain the corresponding test platform component based on the control metadata; the test platform component includes metadata interface call rules;
[0032] The target control metadata acquisition module is used to obtain the target control metadata corresponding to the current interface operation from the control metadata according to the metadata interface call rules;
[0033] The test case creation module is used to create test case steps based on the interface data traffic information and the target control metadata, in order to create test cases.
[0034] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0035] In response to a test case creation request, obtain the interface data traffic information corresponding to the creation request;
[0036] Based on the interface data traffic information, obtain the page metadata of the corresponding interface;
[0037] Obtain the control metadata of the controls in the page to which the page metadata belongs, and obtain the corresponding test platform component based on the control metadata; the test platform component includes metadata interface call rules;
[0038] According to the metadata interface call rules, obtain the target control metadata corresponding to the current interface operation from the control metadata;
[0039] Based on the interface data traffic information and the target control metadata, create test cases by following these steps.
[0040] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0041] In response to a test case creation request, obtain the interface data traffic information corresponding to the creation request;
[0042] Based on the interface data traffic information, obtain the page metadata of the corresponding interface;
[0043] Obtain the control metadata of the controls in the page to which the page metadata belongs, and obtain the corresponding test platform component based on the control metadata; the test platform component includes metadata interface call rules;
[0044] According to the metadata interface call rules, obtain the target control metadata corresponding to the current interface operation from the control metadata;
[0045] Based on the interface data traffic information and the target control metadata, create test cases by following these steps.
[0046] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0047] In response to a test case creation request, obtain the interface data traffic information corresponding to the creation request;
[0048] Based on the interface data traffic information, obtain the page metadata of the corresponding interface;
[0049] Obtain the control metadata of the controls in the page to which the page metadata belongs, and obtain the corresponding test platform component based on the control metadata; the test platform component includes metadata interface call rules;
[0050] According to the metadata interface call rules, obtain the target control metadata corresponding to the current interface operation from the control metadata;
[0051] Based on the interface data traffic information and the target control metadata, create test cases by following these steps.
[0052] The aforementioned test processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product, in response to a test case creation request, acquire the interface data traffic information corresponding to the creation request, acquire the page metadata of the corresponding interface based on the interface data traffic information, obtain the control metadata of the controls in the page to which the page metadata belongs, and obtain the corresponding test platform component based on the control metadata. This test platform component includes metadata interface calling rules. Then, according to the metadata interface calling rules, the target control metadata corresponding to the current interface operation is obtained from the control metadata, and the test case creation steps are quickly and automatically performed based on the interface data traffic information and the target control metadata. This quickly completes the creation of test cases without requiring testers to manually create them, improving the efficiency of test processing. Simultaneously, automated test case creation further saves labor costs and improves the coverage of automated test cases. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a flowchart of a test processing method in one embodiment;
[0055] Figure 2 This is a schematic diagram of page metadata in one embodiment;
[0056] Figure 3 This is a schematic diagram of the control metadata of a control in the page to which the page metadata belongs in one embodiment;
[0057] Figure 4 This is an interface diagram of the metadata type execution rules in one embodiment;
[0058] Figure 5 This is a screenshot of the interface parameter values of a control calling control in one embodiment.
[0059] Figure 6 A diagram illustrating the steps for creating a test case in one embodiment;
[0060] Figure 7 This is a diagram of the metadata interface call rules in one embodiment;
[0061] Figure 8 This is a screenshot of an interface for collecting interface data traffic information via a browser plugin in one embodiment.
[0062] Figure 9 This is a structural block diagram of a test processing device in one embodiment;
[0063] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0065] In one embodiment, such as Figure 1 As shown, a testing method is provided. This embodiment illustrates the application of this method to a computer device, which can be a terminal or a server. It is understood that this method can also be applied to systems including terminals and servers, and implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. This computer device serves as an automated testing platform.
[0066] In this embodiment, the test processing method includes the following steps:
[0067] Step S102: In response to the test case creation request, obtain the interface data traffic information corresponding to the creation request.
[0068] A test case is a description of a testing task for a specific software product, embodying the test plan, methods, techniques, and strategies. Its content includes test objectives, test environment, input data, test steps, expected results, and test scripts, ultimately forming a document. Simply put, a test case is a set of test inputs, execution conditions, and expected results compiled for a specific goal to verify whether a specific software requirement is met. A test case identifier is a unique identifier used to identify a test case.
[0069] Interface data traffic information refers to a collection of interface-related data intercepted and collected by browser plugins during the operation of the testing platform. This testing platform can be a low-code platform. Low-code is an efficient development methodology that accelerates the software development process by abstracting and minimizing manual coding, thus speeding up the development and deployment of customized applications.
[0070] Interface data traffic information includes at least one of the following: use case code, application identifier, page metadata identifier, operation identifier, request parameters, request path, request steps (initial value is 1, value is incremented by 1 for each interface request step executed), and use case identifier.
[0071] The test case code distinguishes different recorded traffic information, ensuring accurate acquisition of relevant interface data during subsequent test case generation. The application identifier is a software menu-level identifier for the domain, application, and page, uniquely identifying the application module to which the interface belongs and clarifying the business scope of the interface operation. The page metadata identifier identifies the page involved in the interface operation and is crucial for locating the metadata of related page controls. The operation identifier describes the specific interface operation performed on the page, such as clicking, loading data, or refreshing, aiding in calculating the target control metadata and creating accurate test case steps. Request parameters contain various parameter values passed during interface operation execution. These parameters are essential for interface functionality and business logic processing and are a key source for determining the actual parameter values of control parameters during test case step creation. The request path specifies the exact address of the interface request, locating the resource location on the interface server. The request steps record the execution order of interface requests, initially set to 1, incrementing by 1 for each executed step. This order allows for sequential processing when traversing interface traffic information to create test case steps. Use case identifiers are used to identify the use case to which a single recorded traffic belongs, playing a role in associating and distinguishing different use cases throughout the entire automated test case creation process.
[0072] For example, the interface data traffic information obtained by the computer device in the creation request corresponding to the use case identifier includes the application identifier (appId), page metadata identifier (f), operation identifier (ac), request parameters (params), request path (url), request step (step), and use case identifier (caseId).
[0073] Optionally, in response to a test case creation request, obtaining the interface data traffic information corresponding to the creation request includes: in response to a test case creation request, obtaining the test case code in the creation request; querying the set of interface data traffic information to be executed by the test case code to obtain the interface data traffic information corresponding to the creation request; the set of interface data traffic information includes at least one set of interface data traffic information.
[0074] The front end of the computer device receives a test case creation request and sends it to the back end. The back end responds to the request, retrieves the test case code from the request, and queries the database to find the set of interface data traffic information required to execute that test case code. This achieves accurate and rapid acquisition of the interface data traffic information set, which is essentially a list of interface data traffic. Test case codes are unique.
[0075] Optionally, the creation request may include test case codes, and may also include unique data such as test case identifiers or test case addresses, which can uniquely query the set of interface data traffic information to be executed.
[0076] Step S104: Based on the interface data traffic information, obtain the page metadata of the corresponding interface.
[0077] Front-end development data is stored as metadata. Page metadata refers to the metadata information of a browser page. Metadata is data about data, mainly describing data properties to support functions such as indicating storage location, historical data, resource lookup, and file records. Figure 2 The diagram shows the page metadata, which includes the form name, logical name, module, and Chinese identifier.
[0078] Optionally, the computer device sorts the data traffic information of each interface in ascending order according to the interface execution steps to obtain the sorted data traffic information of each interface; and obtains the page metadata of the interface corresponding to each interface execution step according to the execution steps of each interface.
[0079] Optionally, the computer device obtains the application identifier and page metadata identifier corresponding to the current interface from the interface data traffic information, determines the application module corresponding to the application identifier, and obtains the page metadata of the page whose page metadata identifier is operated by the application module.
[0080] Step S106: Obtain the control metadata of the controls in the page to which the page metadata belongs, and obtain the corresponding test platform component based on the control metadata; the test platform component includes the metadata interface call rules.
[0081] The page metadata pertains to a page that includes at least one control, and includes information about page elements such as buttons, dropdown buttons, F7 pop-ups, tables, input boxes, etc. Control metadata may include at least one of the following: control identifier, control name, and control metadata type. For example... Figure 3 The image shows a diagram illustrating the control metadata of a control within the page to which the page metadata belongs.
[0082] Test platform components refer to a series of independent modules or tools with specific functions formed within the test platform based on the organization and encapsulation of interface execution rules. Metadata interface call rules refer to a series of defined relationships and execution logic between interface execution parameters and control metadata information within the test platform. These rules clarify how the interface calls based on control metadata in different scenarios, and the execution methods of various operations involved in the call process.
[0083] Optionally, the control metadata includes the control metadata type, which retrieves the test platform component corresponding to that control metadata type. It's understandable that each type of control metadata has independent interface execution logic, such as interface calls, conditional checks, variable assignments, and interface triggers.
[0084] Step S108: According to the metadata interface call rules, obtain the target control metadata corresponding to the current interface operation from the control metadata.
[0085] Among them, the target space metadata is the metadata of the control that the current interface operation needs to operate on.
[0086] Optionally, according to the metadata interface calling rules, the target control metadata corresponding to the current interface operation is obtained from the control metadata, including: obtaining the operation identifier and request parameters of the current interface operation from the interface data traffic information, and determining the operation type based on the operation identifier; determining the metadata type according to the operation type and the structure of the request parameters, and determining the target control identifier corresponding to the metadata type from the request parameters according to the metadata interface calling rules; and obtaining the target control metadata corresponding to the target control identifier from the control metadata.
[0087] Operation types include click, entryRow, loadData, refresh, etc.
[0088] Optionally, the metadata interface invocation rules include metadata type execution rules. The computer device traverses these rules and determines the matching metadata type based on the operation type and the structure of the request parameters. It's understandable that different metadata types have different interface parameter data structures, and control metadata identifiers are included in these data structures, so this method can be used to determine the metadata type. The computer device obtains the data structure of the (interface) request parameters from the interface data traffic information, as well as the interface data traffic information from previous and subsequent calls, to determine the metadata type for the current interface operation execution. For example... Figure 4 The interface diagram for executing rules for metadata types includes the interface execution logic for the metadata type.
[0089] Based on the metadata type, the target control identifier corresponding to the metadata type is calculated from the request parameters, and the target control metadata corresponding to the target control identifier is obtained. Among them, the target control identifier is such as params[0].key, and the target control metadata includes the control name and control type.
[0090] Optionally, according to the metadata interface call rules (metadata type execution rules), obtain the target control metadata identifier and other control metadata identifiers contained in the request parameters for the current interface operation, and obtain the target control metadata identifier and other control metadata identifiers. The target control metadata and other control metadata can be used to create automated test case steps to ensure that the test cases can accurately simulate user operations.
[0091] Step S110: Based on the interface data traffic information and target control metadata, create test cases to create test cases.
[0092] Optionally, based on the interface data traffic information and the target control metadata, a test case creation step is performed to create test cases. This includes: obtaining the control interface parameter values of the interface call control based on the target control identifier and request parameters; determining the request step that matches the operation type; determining the target page parameter values based on the target control identifier and control interface parameter values; and creating test case steps according to the request steps, based on the operation type, target control identifier, and target page parameter values, to create test cases.
[0093] The interface calls the control's interface parameter values, which are used to look up the actual parameters on the test case step page. These parameters include actions such as button clicks, form input, and page number queries. Figure 5 The image shown is a screenshot of the interface parameters for a control that calls an API. For example... Figure 6 The image shown is a screenshot of the interface for creating a test case.
[0094] After all test case steps are completed, the computer equipment produces test cases.
[0095] Optionally, the target page parameter value is determined based on the target control identifier and the control interface parameter value, including: obtaining the mapping relationship between the interface parameter value and the page parameter value from the target control metadata; and determining the target page parameter value from the mapping relationship based on the target control identifier and the control interface parameter value.
[0096] The target metadata information contains the mapping relationship between interface parameter values and page parameter values. By using the target control identifier and the interface control's interface parameter values, the matching target interface parameter values are determined from the mapping relationship.
[0097] The aforementioned test processing method, in response to a test case creation request, obtains the interface data traffic information corresponding to the creation request. Based on the interface data traffic information, it obtains the page metadata of the corresponding interface, acquires the control metadata of the controls within the page to which the page metadata belongs, and obtains the corresponding test platform component based on the control metadata. This test platform component includes metadata interface call rules. Then, according to the metadata interface call rules, it obtains the target control metadata corresponding to the current interface operation from the control metadata. Based on the interface data traffic information and the target control metadata, it quickly and automatically creates test cases, thereby rapidly completing the creation of test cases without requiring testers to manually create them, thus improving the efficiency of test processing. Simultaneously, by automating test case creation, it further saves labor costs and improves the coverage of automated test cases.
[0098] Furthermore, the created automated test cases can be executed successfully without manual modification, improving the usability of the test cases; at the same time, if the metadata is modified, it can be compatible with the impact of changes in the development code, without the need for extensive modifications to the automated test cases, reducing maintenance costs and increasing the maintainability of the test cases.
[0099] Furthermore, by using metadata from the database, the parameter values of the target page are calculated and used as test case step parameters, thereby improving the efficiency of test case maintenance.
[0100] The testing platform maintains a set of page metadata and control metadata. When the page metadata or control metadata changes, only the metadata information needs to be updated; test cases do not need to be maintained. The automated testing platform maintains interface call rules for all metadata types, which can be used to match action words in test case creation steps, and also to be used to convert test cases into interface execution calls during execution.
[0101] In other embodiments, the computer device can directly use the parameters in the interface data traffic information to create test case steps without conversion, which can improve the efficiency of test case generation and test case execution.
[0102] In one embodiment, prior to responding to a test case creation request, the method further includes: obtaining metadata interface call rules and encapsulating the metadata interface call rules into a test platform component; obtaining interface data traffic information; the interface data traffic information is collected through a browser plugin.
[0103] Optionally, the computer device executes different test scenarios for each type of control metadata, based on the type of the control metadata, and collects the interface execution rules for that control metadata type under different scenarios; based on the interface execution rules corresponding to each control metadata, it obtains the metadata interface call rules. For example... Figure 7 The image shown is a screenshot of the metadata interface call rules.
[0104] The request parameters (execution parameters) of the test platform's interfaces are correlated with the control metadata information. Based on the request parameters, the type of metadata to be executed can be determined. By analyzing the interface call rules of the interface metadata, foundational data is provided for the automatic creation of automated test cases. In practice, manual testing involves manipulating page controls through a browser, executing different test scenarios based on the same control metadata type. This process collects the execution rules for all scenarios of that control metadata type and encapsulates these rules into test platform components (which can be used for writing and executing test case steps), preparing for the automatic creation of test cases. These execution rules include, but are not limited to, interface parameter passing, variable judgment, variable extraction, and interface failure verification.
[0105] The metadata interface call rules include control execution rules, control metadata change processing rules, and metadata type interface execution rules. These metadata type interface execution rules include conditional judgment sub-rules, variable assignment sub-rules, interface call sub-rules, and interface triggering judgment sub-rules. Each control metadata type has independent interface execution logic, such as interface calls, conditional judgments, variable assignments, and interface triggering. Specifically, the conditional judgment sub-rule determines the required operation based on the metadata type and context variable values. The variable assignment sub-rule assigns values to variables based on the metadata type and response parameters. The interface call sub-rule executes the interface based on the metadata type and context variable values. The interface triggering judgment sub-rule determines whether interface execution needs to be triggered based on the metadata type and interface response parameters, such as opening a new page or closing a page.
[0106] Computer devices are categorized according to the type of control metadata, and the execution rules of the controls are then defined. Types of control metadata include buttons, dropdown buttons, F7 dialog boxes, tables, and input boxes.
[0107] Computer devices store control metadata information at the level of page metadata. Test case steps are associated with the primary key of control metadata. When control metadata changes, the changed control metadata is updated, which eliminates the impact of control metadata changes on the test case execution results.
[0108] A browser plugin is pre-installed in the browser. This plugin collects the browser's traffic requests (interface data traffic information) and sends these requests to the test platform (computer device). After installation, the plugin includes a button to record traffic. Clicking this button opens a recording interface where users can input test case codes, select "Start," and "Stop." Clicking "Start" initiates recording. During recording, the plugin intercepts all browser interface requests, obtaining interface data traffic information. It then parses the test case codes, application identifiers, page metadata identifiers, operation identifiers, request parameters, request paths, request steps (initially 1, incrementing by 1 for each executed interface request step), and test case identification information from this data traffic information. This information is then sent to the test platform for storage. Clicking "Stop" stops the browser from intercepting requests and ends the recording. Figure 8 The image shown is a screenshot of the interface for collecting API data traffic information through a browser plugin.
[0109] The testing platform (computer equipment) obtains the interface data traffic information sent by the browser plugin and saves the test case code, application identifier, page metadata identifier, operation identifier, request parameters, request path, request steps, and test case identifier information from the interface data traffic information to the database table.
[0110] The automated testing platform provides a front-end entry point for automatically creating automated test cases. Users select the test case code to be created and send a request to the back-end to create the test case. The back-end obtains the traffic request interface data related to the test case code based on the test case code, and then iterates through the interface data in an orderly manner to create the automated test case step by step.
[0111] Based on the traffic request, the testing platform determines all control metadata information under the requested page corresponding to the traffic request, and converts the control metadata information into control data;
[0112] In this embodiment, the computer device obtains the metadata interface call rules and encapsulates the metadata interface call rules into a test platform component. It then obtains the interface data traffic information, which is collected through a browser plugin. By using the browser plugin to record test cases, it obtains the request header, request body, and request parameter information and forwards the traffic to the test platform, thereby improving the efficiency of test processing.
[0113] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0114] Based on the same inventive concept, this application also provides a test processing apparatus for implementing the test processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more test processing apparatus embodiments provided below can be found in the limitations of the test processing method described above, and will not be repeated here.
[0115] In one exemplary embodiment, such as Figure 9 As shown, a test processing device is provided, including: an interface data traffic information acquisition module 902, a page metadata acquisition module 904, a control metadata acquisition module 906, a target control metadata acquisition module 908, and a test case creation module 910, wherein:
[0116] The interface data traffic information acquisition module 902 is used to acquire the interface data traffic information corresponding to the creation request in response to the test case creation request.
[0117] The page metadata acquisition module 904 is used to acquire the page metadata of the corresponding interface based on the interface data traffic information.
[0118] The control metadata acquisition module 906 is used to obtain the control metadata of the controls in the page to which the page metadata belongs, and to obtain the corresponding test platform component based on the control metadata; the test platform component includes the metadata interface call rules;
[0119] The target control metadata acquisition module 908 is used to obtain the target control metadata corresponding to the current interface operation from the control metadata according to the metadata interface call rules;
[0120] The test case creation module 910 is used to create test case steps based on interface data traffic information and target control metadata in order to create test cases.
[0121] The aforementioned test processing device, in response to a test case creation request, obtains the interface data traffic information corresponding to the creation request. Based on the interface data traffic information, it obtains the page metadata of the corresponding interface, acquires the control metadata of the controls within the page to which the page metadata belongs, and obtains the corresponding test platform component based on the control metadata. This test platform component includes metadata interface call rules. Then, according to the metadata interface call rules, it obtains the target control metadata corresponding to the current interface operation from the control metadata. Based on the interface data traffic information and the target control metadata, it quickly and automatically completes the test case creation process, thereby rapidly completing the test case creation without requiring testers to manually create test cases, thus improving the efficiency of test processing. Simultaneously, by automating test case creation, it further saves labor costs and improves the coverage of automated test cases.
[0122] In one embodiment, the interface data traffic information acquisition module 902 is further configured to, in response to a test case creation request, acquire the test case code in the creation request; query the set of interface data traffic information to be executed by the test case code; the set of interface data traffic information includes at least one set of interface data traffic information.
[0123] In one embodiment, the target control metadata acquisition module 908 is further configured to acquire the operation identifier and request parameters of the current interface operation from the interface data traffic information, and determine the operation type based on the operation identifier; determine the metadata type according to the structure of the operation type and request parameters, and determine the target control identifier corresponding to the metadata type from the request parameters according to the metadata interface calling rules; and obtain the target control metadata corresponding to the target control identifier from the control metadata.
[0124] In one embodiment, the test case creation module 910 is further configured to: obtain the control interface parameter value of the interface call control based on the target control identifier and request parameters; determine the request step that matches the operation type; determine the target page parameter value based on the target control identifier and control interface parameter value; and create test case steps according to the request steps, based on the operation type, target control identifier, and target page parameter value, to create test cases.
[0125] In one embodiment, the test case creation module 910 is further configured to obtain the mapping relationship between interface parameter values and page parameter values from the target control metadata; and determine the target page parameter values from the mapping relationship based on the target control identifier and the control interface parameter values.
[0126] In one embodiment, the above-mentioned apparatus further includes a preprocessing module, which is used to obtain metadata interface call rules and encapsulate the metadata interface call rules into a test platform component; and to obtain interface data traffic information; the interface data traffic information is collected through a browser plugin.
[0127] Each module in the aforementioned test processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0128] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores interface data flow information, metadata, interface call rules, and other data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a test processing method.
[0129] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0130] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0131] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0132] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0134] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0135] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0136] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A test processing method, characterized in that, The method includes: In response to a test case creation request, obtain the interface data traffic information corresponding to the creation request; Based on the interface data traffic information, obtain the page metadata of the corresponding interface; Obtain the control metadata of the controls in the page to which the page metadata belongs, and obtain the corresponding test platform component based on the control metadata; the test platform component includes metadata interface call rules; According to the metadata interface calling rules, the target control metadata corresponding to the current interface operation is obtained from the control metadata, including: obtaining the operation identifier and request parameters of the current interface operation from the interface data traffic information, and determining the operation type based on the operation identifier; determining the metadata type according to the operation type and the structure of the request parameters, and determining the target control identifier corresponding to the metadata type from the request parameters according to the metadata interface calling rules; and obtaining the target control metadata corresponding to the target control identifier from the control metadata. Based on the interface data traffic information and the target control metadata, create test cases by following these steps.
2. The method according to claim 1, characterized in that, The step of responding to a test case creation request and obtaining the interface data traffic information corresponding to the creation request includes: In response to a test case creation request, obtain the test case code from the creation request; The set of interface data traffic information required for the use case encoding is queried to obtain the interface data traffic information corresponding to the creation request; the set of interface data traffic information includes at least one interface data traffic information.
3. The method according to claim 1, characterized in that, The interface data traffic information includes at least one of the following: use case code, application identifier, page metadata identifier, operation identifier, request parameters, request path, request steps, and use case identifier.
4. The method according to claim 1, characterized in that, The step of creating test cases based on the interface data traffic information and the target control metadata includes: Based on the target control identifier and the request parameters, obtain the control interface parameter values of the interface call control; Determine the request steps that match the operation type; The target page parameter values are determined based on the target control identifier and the control interface parameter values; Following the request steps, the steps to create test cases are as follows: based on the operation type, the target control identifier, and the target page parameter values.
5. The method according to claim 4, characterized in that, The step of determining the target page parameter value based on the target control identifier and the control interface parameter value includes: Obtain the mapping relationship between interface parameter values and page parameter values from the target control metadata; The target page parameter value is determined from the mapping relationship based on the target control identifier and the control interface parameter value.
6. The method according to any one of claims 1 to 5, characterized in that, The response to the test case creation request also includes: Obtain the metadata interface call rules and encapsulate the metadata interface call rules into a test platform component; The interface data traffic information is obtained through a browser plugin.
7. A testing and processing apparatus, characterized in that, The device includes: The interface data traffic information acquisition module is used to acquire the interface data traffic information corresponding to the creation request in response to the test case creation request. The page metadata acquisition module is used to acquire the page metadata of the corresponding interface based on the interface data traffic information. The control metadata acquisition module is used to obtain the control metadata of the controls in the page to which the page metadata belongs, and to obtain the corresponding test platform component based on the control metadata; the test platform component includes metadata interface call rules; The target control metadata acquisition module is used to obtain the target control metadata corresponding to the current interface operation from the control metadata according to the metadata interface calling rules, including: obtaining the operation identifier and request parameters of the current interface operation from the interface data traffic information, and determining the operation type based on the operation identifier; determining the metadata type according to the operation type and the structure of the request parameters, and determining the target control identifier corresponding to the metadata type from the request parameters according to the metadata interface calling rules; and obtaining the target control metadata corresponding to the target control identifier from the control metadata. The test case creation module is used to create test case steps based on the interface data traffic information and the target control metadata, in order to create test cases.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Automatic data testing method and device, computer equipment and storage medium
CN114637672A
Interface testing method and device of application program, equipment and storage medium
CN117950988A