Test processing method and device, computer equipment, readable storage medium and program product
By obtaining and analyzing interface data traffic information, page metadata and control metadata, we automatically create test cases, solving the problem of inefficiency of traditional test processing methods, realizing rapid and automated test case creation, and improving efficiency and coverage.
Patent Information
- Application Number
- CN202411951045.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-27
AI Technical Summary
Traditional test processing methods are inefficient, take a lot of time, and there is a dependency on manually creating test cases, resulting in high efficiency and cost.
By obtaining interface data traffic information, obtaining page metadata and control metadata, and generating test platform components based on these metadata, including metadata interface call rules, to automatically create test cases.
It realizes rapid and automated test case creation, improves the efficiency of test processing, saves labor costs, and improves the coverage of automated use cases.
Smart Images

Figure CN119759785A_ABST
Abstract
Description
Technical Field
[0001] The present 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 Art
[0002] During the software development process, the testing team often faces a series of challenges, such as repeated appearance of defects after repair, chain defects caused by version compatibility, and user feedback of defects when the system monitoring is normal at the initial launch. These problems require testers to manually create test cases for testing. However, traditional testing processing methods often take a long time and have low efficiency. Summary of the invention
[0003] Based on this, 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 technical problems.
[0004] In a first aspect, the present application provides a test processing method, comprising:
[0005] In response to a test case creation request, obtaining interface data flow information corresponding to the creation request;
[0006] Based on the interface data flow information, obtaining page metadata of the corresponding interface;
[0007] Obtaining the control metadata of the control in the page to which the page metadata belongs, and obtaining the corresponding test platform component according to the control metadata; the test platform component includes a metadata interface calling rule;
[0008] According to the metadata interface calling rule, obtaining the target control metadata corresponding to the current interface operation from the control metadata;
[0009] A test case step is created according to the interface data flow information and the target control metadata to create a test case.
[0010] In one embodiment, in response to a test case creation request, obtaining interface data flow information corresponding to the creation request includes:
[0011] In response to a test case creation request, obtaining a test case code in the creation request;
[0012] The interface data flow information set required to be executed by the use case coding is queried to obtain the interface data flow information corresponding to the creation request; the interface data flow information set includes at least one interface data flow information.
[0013] In one embodiment, obtaining target control metadata corresponding to the current interface operation from the control metadata according to the metadata interface calling rule includes:
[0014] Acquire an operation identifier and request parameters of a current interface operation from the interface data flow information, and determine an operation type based on the operation identifier;
[0015] Determine the metadata type according to the operation type and the structure of the request parameter, and determine the target control identifier corresponding to the metadata type from the request parameter according to the metadata interface calling rule;
[0016] The target control metadata corresponding to the target control identifier is obtained from the control metadata.
[0017] In one embodiment, the step of creating a test case according to the interface data flow information and the target control metadata to create a test case includes:
[0018] According to the target control identifier and the request parameter, obtaining a control interface parameter value of the interface calling control;
[0019] determining a request step matching the operation type;
[0020] Determine a target page parameter value according to the target control identifier and the control interface parameter value;
[0021] According to the request step, a test case step is created according to the operation type, the target control identifier and the target page parameter value to create a test case.
[0022] In one embodiment, determining the target page parameter value according to the target control identifier and the control interface parameter value includes:
[0023] Acquire a mapping relationship between an interface parameter value and a page parameter value from the target control metadata;
[0024] According to the target control identifier and the control interface parameter value, a target page parameter value is determined from the mapping relationship.
[0025] In one embodiment, before responding to the request to create a test case, the method further includes:
[0026] Obtaining metadata interface calling rules, and encapsulating the metadata interface calling rules as test platform components;
[0027] Obtain interface data flow information; the interface data flow information is collected through a browser plug-in.
[0028] In a second aspect, the present application also provides a test processing device, comprising:
[0029] An interface data flow information acquisition module, used to respond to a test case creation request and acquire interface data flow information corresponding to the creation request;
[0030] A page metadata acquisition module, used to acquire page metadata of a corresponding interface based on the interface data flow information;
[0031] A control metadata acquisition module, used to obtain the control metadata of the control in the page to which the page metadata belongs, and obtain the corresponding test platform component according to the control metadata; the test platform component includes a metadata interface calling rule;
[0032] A target control metadata acquisition module is used to obtain target control metadata corresponding to the current interface operation from the control metadata according to the metadata interface calling rule;
[0033] The test case creation module is used to create test case steps according to the interface data flow information and the target control metadata to create a test case.
[0034] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0035] In response to a test case creation request, obtaining interface data flow information corresponding to the creation request;
[0036] Based on the interface data flow information, obtaining page metadata of the corresponding interface;
[0037] Obtaining the control metadata of the control in the page to which the page metadata belongs, and obtaining the corresponding test platform component according to the control metadata; the test platform component includes a metadata interface calling rule;
[0038] According to the metadata interface calling rule, obtaining the target control metadata corresponding to the current interface operation from the control metadata;
[0039] A test case step is created according to the interface data flow information and the target control metadata to create a test case.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0041] In response to a test case creation request, obtaining interface data flow information corresponding to the creation request;
[0042] Based on the interface data flow information, obtaining page metadata of the corresponding interface;
[0043] Obtaining the control metadata of the control in the page to which the page metadata belongs, and obtaining the corresponding test platform component according to the control metadata; the test platform component includes a metadata interface calling rule;
[0044] According to the metadata interface calling rule, obtaining the target control metadata corresponding to the current interface operation from the control metadata;
[0045] A test case step is created according to the interface data flow information and the target control metadata to create a test case.
[0046] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0047] In response to a test case creation request, obtaining interface data flow information corresponding to the creation request;
[0048] Based on the interface data flow information, obtaining page metadata of the corresponding interface;
[0049] Obtaining the control metadata of the control in the page to which the page metadata belongs, and obtaining the corresponding test platform component according to the control metadata; the test platform component includes a metadata interface calling rule;
[0050] According to the metadata interface calling rule, obtaining the target control metadata corresponding to the current interface operation from the control metadata;
[0051] A test case step is created according to the interface data flow information and the target control metadata to create a test case.
[0052] The above-mentioned test processing method, apparatus, computer equipment, computer-readable storage medium and computer program product, in response to a request to create a test case, obtains the interface data flow information corresponding to the creation request, obtains the page metadata of the corresponding interface based on the interface data flow information, obtains the control metadata of the control in the page to which the page metadata belongs, and obtains the corresponding test platform component according to the control metadata, and the test platform component includes a metadata interface calling rule; then, according to the metadata interface calling rule, the target control metadata corresponding to the current interface operation is obtained from the control metadata, and according to the interface data flow information and the target control metadata, the test case steps are quickly and automatically created, thereby quickly completing the creation of the test case, without the need for testers to manually create the test case, thereby improving the efficiency of the test processing. At the same time, by automating the creation of test cases, labor costs are further saved and the coverage of automated cases is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 A flowchart of a test processing method in one embodiment;
[0055] Figure 2 is a schematic diagram of page metadata in one embodiment;
[0056] Figure 3 A schematic diagram of control metadata of a control in a page to which the page metadata belongs in one embodiment;
[0057] Figure 4 An interface diagram of a metadata type execution rule in an embodiment;
[0058] Figure 5 An interface diagram of a control interface parameter value of an interface calling control in one embodiment;
[0059] Figure 6 An interface diagram for creating test case steps in an embodiment;
[0060] Figure 7 An interface diagram of a metadata interface calling rule in an embodiment;
[0061] Figure 8 This is an interface diagram for collecting interface data flow information through a browser plug-in in one embodiment;
[0062] Fig. 9 is a structural block diagram of a test processing device in one embodiment;
[0063] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0065] In one embodiment, Figure 1 As shown, a test processing method is provided. This embodiment uses the method applied to a computer device as an example. The computing device can be a terminal or a server. It can be understood that the method can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The 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 a test case creation request, obtaining interface data flow information corresponding to the creation request.
[0068] Among them, a test case is a description of a test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document. Simply put, a test case is a set of test inputs, execution conditions and expected results compiled for a special goal, used to verify whether a specific software requirement is met. The case identifier is the identifier of the test case, which is used to uniquely identify the test case.
[0069] Interface data flow information refers to a collection of data information related to the interface that is intercepted and collected by browser plug-ins during the operation of the test platform. The test platform can be a low-code platform. Low-code is an efficient development method that can accelerate the software development process. It speeds up the development and deployment of customized applications by abstracting and minimizing manual coding.
[0070] The interface data flow information includes at least one of the use case code, application identifier, page metadata identifier, operation identifier, request parameters, request path, request step (the initial value is 1, and the value increases by 1 each time an interface request step is executed) and use case identifier.
[0071] Among them, the use case code is used to distinguish the traffic information of different recordings, so that the relevant interface data can be accurately obtained when the test case is generated later. The application identifier is the software menu level domain, application, page. The application identifier is the unique identifier of the application menu, indicating the application module to which the interface belongs and clarifying the business scope of the interface operation. The page metadata identifier is used to determine the page involved in the interface operation and is the key basis for locating the metadata of the page-related controls. The operation identifier is used to describe the identifier of the specific current interface operation performed on the page. The current interface operation, such as click, load data, refresh, etc., is helpful for the subsequent calculation of the target control metadata of the current interface operation and the creation of accurate test case steps. The request parameter contains various parameter values passed when executing the interface operation. These parameters are crucial for the functional implementation and business logic processing of the interface, and are also an important source for determining the actual parameter values of the step parameter control when creating the test case steps. The request path is the specific address of the specified interface request, which is used to locate the resource location of the interface server. The request step is used to record the execution order of the interface request. The initial value is 1. The value increases by 1 for each execution of an interface request step. When traversing the interface data traffic information to create the test case steps, it can be processed in an orderly manner according to this order. The use case ID is used to identify the use case to which the traffic recorded once belongs. It plays a role in associating and distinguishing different use cases during the entire automated test case creation process.
[0072] Exemplarily, the computer device obtains the interface data flow information corresponding to the use case identifier in the creation request, including the application identifier (appId), the page metadata identifier (f), the operation identifier (ac), the request parameters (params), the request path (url), the request step (step) and the use case identifier (caseId).
[0073] Optionally, in response to a request to create a test case, interface data traffic information corresponding to the creation request is obtained, including: in response to the request to create the test case, obtaining the use case code in the creation request; querying the interface data traffic information set required to execute the use case code to obtain the interface data traffic information corresponding to the creation request; the interface data traffic information set includes at least one interface data traffic information.
[0074] The front end of the computer device obtains a test case creation request and sends the creation request to the back end of the computer device. The back end responds to the creation request, obtains the use case code in the creation request, and queries the interface data flow information set required to execute the query use case code from the database, thereby realizing accurate and rapid acquisition of the interface data flow information set. The interface data flow information set is an interface data flow list. The use case code is unique.
[0075] Optionally, the creation request includes a use case code and may also include unique data such as a use case identifier or a use case address, so that a set of interface data flow information to be executed can be uniquely queried.
[0076] Step S104: based on the interface data flow information, obtain the page metadata of the corresponding interface.
[0077] Among them, the front-end development data is saved as metadata. Page metadata is the metadata information of the browser page. Metadata is data about data, mainly information describing data properties, used to support functions such as indicating storage location, historical data, resource search, file records, etc. Figure 2 The figure shows a schematic diagram of page metadata, which includes form name, logical name, module and Chinese logo.
[0078] Optionally, the computer device sorts the data flow information of each interface in the positive order of the interface execution steps to obtain the sorted data flow information of each interface; and according to each interface execution step, obtains the page metadata of the interface corresponding to the interface execution step.
[0079] Optionally, the computer device obtains the application identifier and the page metadata identifier corresponding to the current interface from the interface data flow information, determines the application module corresponding to the application identifier, and obtains the page metadata of the page to which the page metadata identifier operated by the application module belongs.
[0080] Step S106, obtaining the control metadata of the control in the page to which the page metadata belongs, and obtaining the corresponding test platform component according to the control metadata; the test platform component includes a metadata interface calling rule.
[0081] The page to which the page metadata belongs includes at least one control, and the page has element information such as buttons, drop-down buttons, F7 pop-up boxes, tables, input boxes, tables, etc. The control metadata may include at least one of the control identifier, control name, and control metadata type. Figure 3 The figure shows a schematic diagram of the control metadata of the control in 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 in the test platform based on the combing and encapsulation of interface execution rules. Metadata interface call rules refer to a series of determined relationships and execution logics between interface execution parameters and control metadata information in the test platform. These rules clarify how the interface is called according to the control metadata in different scenarios, as well as the execution methods of various operations involved in the calling process.
[0083] Optionally, the control metadata includes a control metadata type, and the test platform component corresponding to the control metadata type is obtained. It can be understood that each type of control metadata has an independent interface execution logic, such as interface call, condition judgment, variable assignment, interface triggering, etc.
[0084] Step S108: Obtain target control metadata corresponding to the current interface operation from the control metadata according to the metadata interface calling rule.
[0085] The target space metadata is the metadata of the control that needs to be operated by the current interface operation.
[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 flow 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 according to the metadata interface calling rules, determining the target control identifier corresponding to the metadata type from the request parameters; obtaining the target control metadata corresponding to the target control identifier from the control metadata.
[0087] Among them, the operation types include click=click, entryRow=click row, loadData=load data, refresh=refresh click, etc.
[0088] Optionally, the metadata interface call rules include metadata type execution rules. The computer device traverses the metadata type execution rules and determines the matching metadata type from the metadata type execution rules based on the operation type and the structure of the request parameters. It is understandable that because different metadata types have different interface parameter data structures, and the control metadata identifier will be included in the data structure, the metadata type can be determined in this way. The computer device obtains the data structure of the (interface) request parameters in the interface data flow information, as well as the previous and subsequent interface data flow information, for the metadata type executed by the current interface operation. Figure 4 It is an interface diagram of a metadata type execution rule, where the metadata type execution rule includes the interface execution logic of the metadata type.
[0089] According to 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. 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 of the current interface operation and other control metadata identifiers contained in the request parameters, and obtain the target control metadata of the target control metadata identifier and other control metadata of the 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 case can accurately simulate user operations.
[0091] Step S110, creating a test case step according to the interface data flow information and the target control metadata to create a test case.
[0092] Optionally, test case steps are created based on the interface data flow information and the target control metadata to create a test case, including: obtaining the control interface parameter value of the interface calling control based on the target control identifier and the request parameters; determining the request step that matches the operation type; determining the target page parameter value based on the target control identifier and the control interface parameter value; and creating test case steps according to the request step, based on the operation type, the target control identifier and the target page parameter value to create a test case.
[0093] The control interface parameter value of the control called by the interface is used to find the actual parameters of the page of the creation use case step. The action of the request step is such as button click, form input, page number query, etc. Figure 5 The following is an interface diagram of the control interface parameter value of the interface calling control. Figure 6 The following is an interface diagram showing the steps for creating a test case.
[0094] The computer device obtains the test case after each test case step is created.
[0095] Optionally, the target page parameter value is determined according to the target control identifier and the control interface parameter value, including: obtaining a 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 according to the target control identifier and the control interface parameter value.
[0096] The target metadata information includes the mapping relationship between the interface parameter value and the page parameter value. The matching target interface parameter value is determined from the mapping relationship through the target control identifier and the interface control interface parameter value.
[0097] The above-mentioned test processing method, in response to a test case creation request, obtains the interface data flow information corresponding to the creation request, obtains the page metadata of the corresponding interface based on the interface data flow information, obtains the control metadata of the control in the page to which the page metadata belongs, and obtains the corresponding test platform component according to the control metadata, and the test platform component includes a metadata interface calling rule; then, according to the metadata interface calling rule, the target control metadata corresponding to the current interface operation is obtained from the control metadata, and according to the interface data flow information and the target control metadata, the test case steps are quickly and automatically created, thereby quickly completing the creation of the test case, without the need for testers to manually create the test case, thereby improving the efficiency of the test processing. At the same time, by automating the creation of test cases, labor costs are further saved and the coverage of automated cases is improved.
[0098] Furthermore, the created automated test cases can be executed successfully directly without manual modification, which improves the availability of the test cases. At the same time, if the metadata is modified, it can be compatible with the impact of development code changes, without the need to modify a large number of automated test cases, reducing maintenance costs and increasing the maintainability of test cases.
[0099] Furthermore, the target page parameter values are calculated through the metadata database information as the use case step parameters, thereby improving the use case maintenance efficiency.
[0100] The test platform maintains a copy of page metadata and control metadata. When page metadata or control metadata changes, only the metadata information needs to be updated, and there is no need to maintain the use case. The automated test platform maintains interface call rules for all metadata types, which can be used to create a match for the action words of the use case steps, and can also be used to convert the execution call of the interface when the test case is executed.
[0101] In other embodiments, the computer device may directly use the parameters in the interface data flow information to create test case steps without conversion, thereby improving the test case generation efficiency and the test case execution efficiency.
[0102] In one embodiment, before responding to a request to create a test case, it also includes: obtaining metadata interface calling rules and encapsulating the metadata interface calling rules as a test platform component; obtaining interface data flow information; the interface data flow information is collected through a browser plug-in.
[0103] Optionally, the computer device executes different test scenarios for each type of control metadata according to the type of the control metadata, collects interface execution rules for the type of control metadata in different scenarios, and obtains metadata interface call rules based on the interface execution rules corresponding to each control metadata. Figure 7 Shown is the interface diagram of the metadata interface calling rules.
[0104] The request parameters (execution parameters) of the test platform interface are associated with the control metadata information. Based on the request parameters, the metadata type to be executed can be determined. By combing the interface call rules of the interface metadata, basic data is provided for the automatic creation of automated test cases. It is understandable that in actual manual testing, different test scenarios are executed according to the same control metadata type through the browser operation page controls, and then the execution rules of the interface in all scenarios of the control metadata type are collected, and the rules are encapsulated as test platform components (the components of the test platform can be used for the writing and execution of use case steps) to prepare for the automatic creation of test cases. Among them, the execution rules include but are not limited to interface parameter passing, variable judgment, variable extraction, interface failure verification, etc.
[0105] The metadata interface call rules include control execution rules, control metadata change processing rules and metadata type interface execution rules. The metadata type interface execution rules include condition judgment sub-rules, variable assignment sub-rules, interface call sub-rules and trigger interface judgment sub-rules. Each control metadata type has independent interface execution logic, such as interface call, condition judgment, variable assignment, interface trigger, etc. Among them, the condition judgment sub-rule: judge the operation to be performed according to the metadata type and context variable value. Variable assignment sub-rule: assign variables according to the metadata type and response parameters. Interface call sub-rule: execute the interface according to the metadata type and context variable value. Trigger interface judgment sub-rule: judge whether the interface execution needs to be triggered according to the metadata type and interface response parameters, such as opening a new page or closing a page.
[0106] Computer devices are classified according to the type of control metadata, and control execution rules are sorted out. The types of control metadata include buttons, drop-down buttons, F7 pop-up boxes, tables, input boxes, etc.
[0107] The computer device saves the control metadata information in the dimension of page metadata, associates the test case steps with the control metadata primary key, and when the control metadata changes, updates the changed control metadata to eliminate the impact of the control metadata change on the test case execution results.
[0108] A browser plug-in is pre-installed in the browser. The browser plug-in is used to collect the traffic requests of the browser (interface data traffic information) and send the traffic requests (interface data traffic information) to the test platform (computer equipment). After the browser plug-in is installed, the browser plug-in has a button entrance for recording traffic. Click the button entrance to pop up the recording interface. The recording interface can input the recorded use case coding information, start button, and end button. Click the start button to start the recording function. During the recording period, the browser plug-in will intercept the request information of all interfaces of the browser, obtain the interface data traffic information, and parse the use case code, application identifier, page metadata identifier, operation identifier, request parameter, request path, request step (the initial value is 1, and the value increases by 1 for each interface request step executed), and use case identification information from the interface data traffic information, and send the interface data traffic information to the test platform for storage; click the end button to end the traffic recording without intercepting the request. Figure 8 The figure shows the interface diagram for collecting interface data flow information through a browser plug-in.
[0109] The test platform (computer device) obtains the interface data flow information sent by the browser plug-in, and saves the use case code, application identifier, page metadata identifier, operation identifier, request parameters, request path, request steps, and use case identifier information in the interface data flow information into a database table.
[0110] The automated testing platform provides a front-end entry for automatically creating automated test cases. You select the case code to be created and send a request to create a case to the back-end. The back-end obtains the traffic request interface data related to the case code based on the case code, and then traverses the interface data in order to gradually create automated test case steps.
[0111] The test platform determines all control metadata information under the request page corresponding to the traffic request based on the traffic request, and converts the control metadata information into control data;
[0112] In this embodiment, the computer device obtains the metadata interface calling rules, and encapsulates the metadata interface calling rules into a test platform component, obtains the interface data flow information, and the interface data flow information is collected through a browser plug-in. The browser plug-in is used to record the use case technology to obtain the request header, request body, and request parameter information and forward the traffic to the test platform, thereby improving the efficiency of the test processing.
[0113] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0114] Based on the same inventive concept, the embodiment of the present application also provides a test processing device for implementing the test processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more test processing device embodiments provided below can refer to the limitations on the test processing method above, and will not be repeated here.
[0115] In an exemplary embodiment, Fig. 9 As shown, a test processing device is provided, including: an interface data flow 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 flow information acquisition module 902 is used to respond to the test case creation request and obtain the interface data flow information corresponding to the 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 flow information;
[0118] The control metadata acquisition module 906 is used to obtain the control metadata of the control in the page to which the page metadata belongs, and obtain the corresponding test platform component according to the control metadata; the test platform component includes the metadata interface calling 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 calling rules;
[0120] The test case creation module 910 is used to create test case steps according to the interface data flow information and the target control metadata to create a test case.
[0121] The above-mentioned test processing device, in response to the test case creation request, obtains the interface data flow information corresponding to the creation request, obtains the page metadata of the corresponding interface based on the interface data flow information, obtains the control metadata of the control in the page to which the page metadata belongs, and obtains the corresponding test platform component according to the control metadata, and the test platform component includes the 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 according to the interface data flow information and the target control metadata, the test case steps are quickly and automatically created, thereby quickly completing the creation of the test case, without the need for the tester to manually create the test case, thereby improving the efficiency of the test processing. At the same time, by automating the creation of test cases, labor costs are further saved and the coverage of automated cases is improved.
[0122] In one embodiment, the above-mentioned interface data flow information acquisition module 902 is also used to respond to a test case creation request, obtain the use case code in the creation request; query the interface data flow information set required to execute the use case code; the interface data flow information set includes at least one interface data flow information.
[0123] In one embodiment, the target control metadata acquisition module 908 is also used to obtain the operation identifier and request parameters of the current interface operation from the interface data flow information, and determine the operation type based on the operation identifier; determine the metadata type according to the operation type and the structure of the request parameters, and determine the target control identifier corresponding to the metadata type from the request parameters according to the metadata interface calling rules; obtain the target control metadata corresponding to the target control identifier from the control metadata.
[0124] In one embodiment, the above-mentioned test case creation module 910 is also used to obtain the control interface parameter value of the interface calling control according to the target control identifier and the request parameters; determine the request step that matches the operation type; determine the target page parameter value according to the target control identifier and the control interface parameter value; according to the request step, create test case steps according to the operation type, target control identifier and target page parameter value to create a test case.
[0125] In one embodiment, the test case creation module 910 is also used to obtain the mapping relationship between the interface parameter value and the page parameter value from the target control metadata; and determine the target page parameter value from the mapping relationship according to the target control identifier and the control interface parameter value.
[0126] In one embodiment, the above-mentioned device also includes a preprocessing module, which is used to obtain metadata interface calling rules and encapsulate the metadata interface calling rules into a test platform component; obtain interface data flow information; the interface data flow information is collected through a browser plug-in.
[0127] Each module in the above test processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0128] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as interface data flow information and metadata interface call rules. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a test processing method is implemented.
[0129] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0130] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0132] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[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, stored data, displayed data, 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 relevant data must comply with relevant regulations.
[0134] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0135] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A test processing method, characterized in that: The method comprises: In response to a test case creation request, obtaining interface data flow information corresponding to the creation request; Based on the interface data flow information, obtaining page metadata of the corresponding interface; Obtaining the control metadata of the control in the page to which the page metadata belongs, and obtaining the corresponding test platform component according to the control metadata; the test platform component includes a metadata interface calling rule; According to the metadata interface calling rule, obtaining the target control metadata corresponding to the current interface operation from the control metadata; A test case step is created according to the interface data flow information and the target control metadata to create a test case.
2. The method according to claim 1, characterized in that The step of obtaining, in response to a test case creation request, interface data flow information corresponding to the creation request includes: In response to a test case creation request, obtaining a test case code in the creation request; The interface data flow information set required to be executed by the use case coding is queried to obtain the interface data flow information corresponding to the creation request; the interface data flow information set includes at least one interface data flow information.
3. The method according to claim 1, characterized in that The step of obtaining target control metadata corresponding to the current interface operation from the control metadata according to the metadata interface calling rule includes: Acquire an operation identifier and request parameters of a current interface operation from the interface data flow information, and determine an operation type based on the operation identifier; Determine the metadata type according to the operation type and the structure of the request parameter, and determine the target control identifier corresponding to the metadata type from the request parameter according to the metadata interface calling rule; The target control metadata corresponding to the target control identifier is obtained from the control metadata.
4. The method according to claim 3, characterized in that: The step of creating a test case according to the interface data flow information and the target control metadata to create a test case includes: According to the target control identifier and the request parameter, obtaining a control interface parameter value of the interface calling control; determining a request step matching the operation type; Determine a target page parameter value according to the target control identifier and the control interface parameter value; According to the request step, a test case step is created according to the operation type, the target control identifier and the target page parameter value to create a test case.
5. The method according to claim 4, characterized in that The step of determining a target page parameter value according to the target control identifier and the control interface parameter value includes: Acquire a mapping relationship between an interface parameter value and a page parameter value from the target control metadata; According to the target control identifier and the control interface parameter value, a target page parameter value is determined from the mapping relationship.
6. The method according to any one of claims 1 to 5, characterized in that: Before responding to the test case creation request, the method further includes: Obtaining metadata interface calling rules, and encapsulating the metadata interface calling rules as test platform components; Obtain interface data flow information; the interface data flow information is collected through a browser plug-in.
7. A test processing device, characterized in that: The device comprises: An interface data flow information acquisition module, used to respond to a test case creation request and acquire interface data flow information corresponding to the creation request; A page metadata acquisition module, used to acquire page metadata of a corresponding interface based on the interface data flow information; A control metadata acquisition module, used to obtain the control metadata of the control in the page to which the page metadata belongs, and obtain the corresponding test platform component according to the control metadata; the test platform component includes a metadata interface calling rule; A target control metadata acquisition module is used to obtain target control metadata corresponding to the current interface operation from the control metadata according to the metadata interface calling rule; The test case creation module is used to create test case steps according to the interface data flow information and the target control metadata to create a test case.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Software test apparatus and test method
CN101339534A
Automatic data testing method and device, computer equipment and storage medium
CN114637672A
Test script generation method and device, computer equipment and storage medium
CN117389897A
Interface testing method and device of application program, equipment and storage medium
CN117950988A
Efficiently generating test cases
US20140172512A1