A method and system for automatically generating cases
By using regular expression matching and interface document segmentation technology, automated generation and execution of automated cases are solved, and the problem of automated case creation in the existing technology depends on manual labor and low execution efficiency is achieved, and efficient and automated case management and execution are achieved.
Patent Information
- Application Number
- CN202111149454.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2041-09-29
AI Technical Summary
The creation of existing automation cases relies on manual labor, resulting in high labor costs and low efficiency in execution of automation cases. Especially when the test environment data changes, automation cases cannot be executed normally and require frequent manual maintenance.
The streaming packets in the message log are matched through pre-established regular expressions, and the transaction type packet is extracted, and the interface document is combined with the message header and message style are divided, the data dictionary is generated, the data dictionary is filled and the automation case is generated to achieve automated execution.
It reduces labor costs, improves the efficiency of automation case execution, ensures that automation cases can be executed normally when the test environment data changes, and reduces the frequency of manual maintenance.
Smart Images

Figure CN113886234B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of automated data processing, and more specifically, to an automated case generation method and system. Background Art
[0002] Automated testing generally includes screen-level automated testing and interface-level automated testing. Interface-level automated testing targets interface calls, automatically transmits data that complies with interface specifications, and receives return results.
[0003] At present, the automated case establishment and maintenance method relies on manual entry, maintenance and execution. Data collection is initiated by the front-end, which extracts transaction data, enters the case format according to the interface document, and generates automated cases after importing.
[0004] Traditional automation case creation mainly relies on manual work, from data acquisition, case establishment, case execution, case maintenance, etc., all rely mainly on manual work. In addition, during the case execution stage, when executing automation cases through regression testing, due to the solidification of data in the automation cases, when the test environment data changes, the data in the automation cases becomes unavailable, or abnormal status occurs, making it impossible for the case to be executed normally. Manual maintenance is required frequently, resulting in a waste of manpower costs and reduced efficiency of regression testing.
[0005] Therefore, the existing automation case creation has high labor costs and low efficiency in executing automation cases. Summary of the invention
[0006] In view of this, the present application discloses an automated case generation method and system, aiming to reduce labor costs and improve the efficiency of executing automated cases.
[0007] In order to achieve the above purpose, the disclosed technical solution is as follows:
[0008] The first aspect of the present application discloses an automated case generation method, the method comprising:
[0009] Matching the streaming messages in the message log by using a pre-established regular expression to obtain the message content of the streaming messages, and extracting the transaction type messages from the message content; the streaming messages are used to represent messages transmitted in the form of continuous character strings;
[0010] The streaming message is segmented by the pre-read interface document to obtain a message header and a message body of the streaming message;
[0011] Generate a data dictionary according to the message of the transaction type, the message header, the message body and a preset message specification format;
[0012] Filling the message content of the streaming message into the data dictionary;
[0013] Generate automation cases based on the populated data dictionary and execute them.
[0014] Preferably, the process of establishing the regular expression includes:
[0015] Acquire message elements in the stream message; the message elements at least include a message type, a transaction code, a start identifier, and an end identifier;
[0016] The message type, the transaction code, the start identifier and the end identifier are concatenated to obtain a regular expression.
[0017] Preferably, matching the streaming messages in the message log by using a pre-established regular expression to obtain the message content of the streaming messages, and extracting the transaction type messages from the message content includes:
[0018] Determine the start identifier and the end identifier corresponding to the streaming message in the message log by using the regular expression;
[0019] Marking the starting position of the streaming message by the start identifier;
[0020] Marking the end position of the streaming message by the end marker;
[0021] intercepting a message between a starting position of the stream message and an ending position of the stream message to obtain message content of the stream message;
[0022] Determine the transaction type field in the message content by using the regular expression and the transaction code;
[0023] Based on the transaction type field, a message of the transaction type is obtained.
[0024] Preferably, the step of segmenting the streaming message by using the pre-read interface document to obtain a message header and a message body of the streaming message includes:
[0025] Read the interface documentation;
[0026] Generate n data fields based on the interface document; n is an integer greater than or equal to 1;
[0027] The stream message is segmented by the n data fields to obtain a message header and a message body of the stream message.
[0028] Preferably, after generating and executing the automation case based on the populated data dictionary, the method further includes:
[0029] Extracting the execution result of the automation case and determining the execution result;
[0030] If the execution result is a preset result, the state of the automation case corresponding to the execution result is marked as executable and updated; the preset result is used to indicate the existence of a transaction type message;
[0031] If the execution result is not the preset result, the state of the automation case corresponding to the execution result is marked as a maintenance pending state.
[0032] A second aspect of the present application discloses an automated case generation system, the system comprising:
[0033] A matching unit, used to match the streaming messages in the message log by a pre-established regular expression, obtain the message content of the streaming messages, and extract the transaction type messages from the message content; the streaming messages are used to represent messages transmitted in the form of continuous character strings;
[0034] A segmentation unit, configured to segment the stream message by using the pre-read interface document to obtain a message header and a message body of the stream message;
[0035] A generating unit, configured to generate a data dictionary according to the message of the transaction type, the message header, the message body and a preset message specification format;
[0036] A filling unit, used to fill the message content of the streaming message into the data dictionary;
[0037] The execution unit is used to generate and execute automation cases based on the populated data dictionary.
[0038] Preferably, the matching unit in the process of establishing the regular expression includes:
[0039] A first acquisition module, configured to acquire message elements in the stream message; the message elements at least include a message type, a transaction code, a start identifier, and an end identifier;
[0040] The splicing module is used to splice the message type, the transaction code, the start identifier and the end identifier to obtain a regular expression.
[0041] Preferably, the matching unit comprises:
[0042] A first determination module, used to determine the start identifier and the end identifier corresponding to the streaming message in the message log by using the regular expression;
[0043] A first marking module, used for marking the starting position of the streaming message by using the start identifier;
[0044] A second marking module, used for marking the end position of the streaming message by using the end mark;
[0045] An interception module, used for intercepting the message between the starting position of the streaming message and the ending position of the streaming message to obtain the message content of the streaming message;
[0046] A second determination module, configured to determine a transaction type field in the message content by using the regular expression and the transaction code;
[0047] The second acquisition module is used to obtain a message of the transaction type based on the transaction type field.
[0048] Preferably, the segmentation unit comprises:
[0049] Reading module, used to read interface documents;
[0050] A generating module, used to generate n data fields based on the interface document; wherein n is an integer greater than or equal to 1;
[0051] The segmentation module is used to segment the streaming message according to the n data fields to obtain the message header and message body of the streaming message.
[0052] Preferably, it also includes:
[0053] An extraction unit, used for extracting the execution result of the automation case and determining the execution result;
[0054] A first marking unit, configured to mark the state of the automation case corresponding to the execution result as executable and update the state if the execution result is a preset result; the preset result is used to indicate the existence of a transaction type message;
[0055] The second marking unit is configured to mark the state of the automation case corresponding to the execution result as a maintenance pending state if the execution result is not the preset result.
[0056] Through the above technical solution, it can be known that the streaming messages in the message log are matched by a pre-established regular expression to obtain the message content of the streaming message, and the transaction type message is extracted from the message content. The streaming message is used to represent the message transmitted in the form of a continuous string. The streaming message is segmented by the pre-read interface document to obtain the message header and message body of the streaming message. According to the message of the transaction type, the message header, the message body and the preset message specification format, a data dictionary is generated, and the message content of the streaming message is filled into the data dictionary. Based on the filled data dictionary, an automated case is generated and executed. Through the above solution, in the process of executing the automated case, there is no need to manually perform operations such as data acquisition, case establishment, case execution, and case maintenance, thereby reducing labor costs, and the latest transaction data is matched by regular expressions to be synchronously updated to the automated case. The data of the automated case is not solidified, so when the test environment data changes, the automated case can be executed normally, thereby improving the efficiency of executing the automated case. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0058] Figure 1 A flowchart of an automated case generation method disclosed in an embodiment of the present application;
[0059] Figure 2 A schematic diagram of a process for establishing a regular expression disclosed in an embodiment of the present application;
[0060] Figure 3 A schematic diagram of a process of obtaining the message content of a streaming message and extracting a message of a transaction type from the message content disclosed in an embodiment of the present application;
[0061] Figure 4 A schematic diagram of a flow chart of segmenting a streaming message by pre-reading an interface document to obtain a message header and a message body of the streaming message as disclosed in an embodiment of the present application;
[0062] Figure 5 A schematic diagram of the structure of an automated case generation system disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0064] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0065] As can be seen from the background technology, the existing automation case creation has high labor costs and low efficiency in executing the automation case.
[0066] In order to solve the above problems, the embodiment of the present application discloses an automated case generation method and system. In the process of executing the automated case, there is no need to manually perform data acquisition, case establishment, case execution, case maintenance and other operations, thereby reducing labor costs, and the latest transaction data is synchronously updated to the automated case by matching regular expressions. The data of the automated case is not solidified, so when the test environment data changes, the automated case can be executed normally, thereby improving the efficiency of executing the automated case. The specific implementation method is described by the following embodiment.
[0067] refer to Figure 1 FIG. 1 is a flow chart of an automated case generation method disclosed in an embodiment of the present application. The automated case generation method mainly includes the following steps:
[0068] S101: Match the streaming messages in the message log by using a pre-established regular expression to obtain the message content of the streaming messages, and extract the transaction type messages from the message content; the streaming messages are used to represent messages transmitted in the form of continuous character strings.
[0069] In S101, a scanning time range is set according to the frequency and volume of message log generation, and streaming messages in the message log are scanned within the scanning time range.
[0070] The specific scanning time range is determined by the technicians according to the actual situation, and this application does not make any specific restrictions.
[0071] The process of matching the streaming messages in the message log with the pre-established regular expression to obtain the message content of the streaming messages and extracting the transaction type messages from the message content is as shown in A1-A6:
[0072] A1: Use regular expressions to determine the start and end markers of the streaming messages in the message log.
[0073] The streaming message includes the message sender, receiver, message type, transaction code, start mark and end mark, etc.
[0074] A regular expression is a logical formula for string operations. It uses some pre-defined specific characters and combinations of these specific characters to form a "regular string". This "regular string" is used to express a filtering logic for the string.
[0075] The process of building a regular expression is as follows:
[0076] First, obtain the message elements in the streaming message; the message elements at least include the message type, transaction code, start identifier and end identifier, and then concatenate the message type, transaction code, start identifier and end identifier to obtain a regular expression.
[0077] A2: Use the start marker to mark the starting position of the streaming message.
[0078] A3: Use the end marker to mark the end position of the streaming message.
[0079] A4: intercept the message between the start position of the stream message and the end position of the stream message to obtain the message content of the stream message.
[0080] A5: Use regular expressions and transaction codes to determine the transaction type field in the message content.
[0081] Among them, after extracting the message content in the log, since there is a transaction type field (transaction code) in the message content, the log scanning program and scanning time range are set, and the transaction type field at the latest moment is matched through a regular expression.
[0082] A6: Based on the transaction type field, obtain the message of the transaction type.
[0083] The transaction type field determines the latest message of the transaction type and marks it.
[0084] S102: Segment the streaming message by using the pre-read interface document to obtain a message header and a message body of the streaming message.
[0085] In S102, the interface document is read, and n data fields are generated based on the interface document, where n is an integer greater than or equal to 1. The streaming message is segmented by the n data fields to obtain a message header and a message body of the streaming message.
[0086] The data field is represented by i, and the length of the data field is len(i), where 0<i≤n.
[0087] The interface document enables front-end and back-end engineers to have a unified file for communication and development during the project development process, and it is convenient for later personnel to view, maintain and perform other operations during project maintenance or project personnel changes.
[0088] S103: Generate a data dictionary according to the message of the transaction type, the message header, the message body and the preset message specification format.
[0089] In S103, when reading the interface document, an interface document specification corresponding to the interface document is obtained, and a preset message specification format is generated based on the interface document specification.
[0090] The default interface document specification is that when the front-end and back-end are separated, the back-end can use different back-end applications to develop similar functions, so the rules for front-end and back-end request responses are consistent. If a set of standards is installed to write interfaces, the back-end and the front-end can interact in the same way regardless of other programming languages.
[0091] A data dictionary is a collection of information that describes data items, data structures, data flows, data storage, processing logic, etc. Its purpose is to provide a detailed description of each element in a data flow diagram. Use a data dictionary for simple modeling projects. In short, a data dictionary is a collection of information that describes data.
[0092] S104: Fill the message content of the streaming message into the data dictionary.
[0093] In S104, the message content of the stream message is filled into the data dictionary, so that the data in the data dictionary corresponds to the format of the message content of the stream message one by one.
[0094] S105: Generate and execute automation cases based on the populated data dictionary.
[0095] After executing the automation case, the execution result of the automation case is extracted and judged.
[0096] If the execution result is a preset result, the state of the automation case corresponding to the execution result is marked as executable and updated; the preset result is used to represent the message with the transaction type.
[0097] If the execution result is not the preset result, the status of the automation case corresponding to the execution result is marked as a maintenance pending status.
[0098] Among them, if the execution result is not the preset result, the scanning range of the message log is expanded, the message logs of other dates and time periods are selected, and the streaming messages in the message logs are matched by pre-established regular expressions to obtain the message content of the streaming messages, and the transaction type messages are extracted from the message content.
[0099] In order to facilitate understanding of the process of determining that the execution result is the preset result, an example is given here to illustrate:
[0100] For example, in the message log of a certain day or a certain period, no transaction occurs, and it is determined that there is no transaction type message, that is, the regular expression does not match and extract the transaction type message from the message content, then the execution result is not the preset result.
[0101] Optionally, maintain and update automation cases.
[0102] The update methods include manual case update and automatic case update. Manual case update: Execute the established automated case. If the expected result cannot be obtained / execution fails, the case status is changed to "pending maintenance" and the step of matching the streaming messages in the message log with the pre-established regular expression is re-executed to obtain the message content of the streaming message and extract the transaction type message from the message content.
[0103] Automatically update cases. Set up a log scanning program to scan the message log regularly to match the latest transaction type message. If the preset result cannot be obtained or the execution fails, change the case status to "pending maintenance" and re-execute the step of matching the streaming message in the message log with the pre-established regular expression to obtain the message content of the streaming message and extract the transaction type message from the message content until the expected result can be obtained. Then update the case status to "latest executable" and update the time of the automated test case synchronously.
[0104] In the embodiment of the present application, in the process of executing the automated case, there is no need to manually perform operations such as data acquisition, case creation, case execution, and case maintenance, thereby reducing labor costs. In addition, the latest transaction data is synchronously updated to the automated case by matching regular expressions. The data of the automated case is not solidified, so when the test environment data changes, the automated case can be executed normally, thereby improving the efficiency of executing the automated case.
[0105] refer to Figure 2 As shown, the process of establishing the regular expression involved in the above S101 mainly includes the following steps:
[0106] S201: Acquire message elements in a streaming message; the message elements at least include a message type, a transaction code, a start identifier, and an end identifier.
[0107] S202: Concatenate the message type, transaction code, start identifier and end identifier to obtain a regular expression.
[0108] The execution principle of S201-S202 is consistent with the execution principle of the above-mentioned S101, which can be used for reference and will not be repeated here.
[0109] In an embodiment of the present application, message elements in a streaming message are obtained; the message elements include at least a message type, a transaction code, a start identifier and an end identifier, so as to achieve the purpose of splicing the message type, the transaction code, the start identifier and the end identifier to obtain a regular expression.
[0110] refer to Figure 3 As shown, the process of matching the streaming messages in the message log by using a pre-established regular expression in the above S101, obtaining the message content of the streaming messages, and extracting the transaction type messages from the message content mainly includes the following steps:
[0111] S301: Determine the start identifier and the end identifier corresponding to the streaming message in the message log by using a regular expression.
[0112] S302: Mark the starting position of the streaming message with a start marker.
[0113] S303: Mark the end position of the streaming message with an end marker.
[0114] S304: intercepting the message between the start position of the stream message and the end position of the stream message to obtain the message content of the stream message.
[0115] S305: Determine the transaction type field in the message content through the regular expression and the transaction code.
[0116] S306: Based on the transaction type field, obtain a message of the transaction type.
[0117] The execution principle of S301-S306 is consistent with the execution principle of the above-mentioned S101, which can be used for reference and will not be repeated here.
[0118] In the embodiment of the present application, the streaming messages in the message log are matched by regular expressions to obtain the message content of the streaming messages, thereby achieving the purpose of extracting transaction type messages from the message content.
[0119] refer to Figure 4As shown, the process of segmenting the streaming message by the pre-read interface document involved in the above S102 to obtain the message header and message body of the streaming message mainly includes the following steps:
[0120] S401: Read the interface document.
[0121] S402: Generate n data fields based on the interface document; n is an integer greater than or equal to 1.
[0122] S403: Segment the streaming message according to the n data fields to obtain a message header and a message body of the streaming message.
[0123] The execution principle of S401-S403 is consistent with the execution principle of the above-mentioned S102, which can be used for reference and will not be repeated here.
[0124] In the embodiment of the present application, the data field is obtained by reading the interface document, and the streaming message is segmented according to the data field, so as to achieve the purpose of obtaining the message header and message body of the streaming message.
[0125] Based on the above embodiments Figure 1 The disclosed automatic case generation method, the embodiment of the present application also discloses an automatic case generation system, such as Figure 5 As shown, the automated case generation system includes a matching unit 501 , a segmentation unit 502 , a generation unit 503 , a filling unit 504 and an execution unit 505 .
[0126] The matching unit 501 is used to match the streaming messages in the message log by using a pre-established regular expression to obtain the message content of the streaming messages and extract the transaction type messages from the message content; the streaming messages are used to represent messages transmitted in the form of continuous character strings.
[0127] The segmentation unit 502 is used to segment the streaming message according to the pre-read interface document to obtain the message header and message body of the streaming message.
[0128] The generating unit 503 is used to generate a data dictionary according to the message of the transaction type, the message header, the message body and the preset message standard format.
[0129] The filling unit 504 is used to fill the message content of the streaming message into the data dictionary.
[0130] The execution unit 505 is used to generate and execute automation cases based on the filled data dictionary.
[0131] Furthermore, the matching unit 501 of the regular expression establishment process includes a first acquisition module and a splicing module.
[0132] The first acquisition module is used to acquire message elements in the streaming message; the message elements at least include a message type, a transaction code, a start identifier and an end identifier.
[0133] The splicing module is used to splice the message type, transaction code, start identifier and end identifier to obtain a regular expression.
[0134] Furthermore, the matching unit 501 includes a first determination module, a first marking module, a second marking module, a capture module, a second determination module and a second acquisition module.
[0135] The first determination module is used to determine the start identifier and the end identifier corresponding to the streaming message in the message log through a regular expression.
[0136] The first marking module is used to mark the starting position of the streaming message through a start mark.
[0137] The second marking module is used to mark the end position of the streaming message through an end mark.
[0138] The interception module is used to intercept the message between the start position of the streaming message and the end position of the streaming message to obtain the message content of the streaming message.
[0139] The second determination module is used to determine the transaction type field in the message content through a regular expression and a transaction code.
[0140] The second acquisition module is used to obtain a message of the transaction type based on the transaction type field.
[0141] Furthermore, the segmentation unit 502 includes a reading module, a generating module and a segmentation module.
[0142] Reading module, used to read interface documents.
[0143] A generation module is used to generate n data fields based on the interface document; n is an integer greater than or equal to 1.
[0144] The segmentation module is used to segment the streaming message according to n data fields to obtain the message header and message body of the streaming message.
[0145] Furthermore, the automated case generation system also includes an extraction unit, a first marking unit and a second marking unit.
[0146] The extraction unit is used to extract the execution result of the execution automation case and determine the execution result.
[0147] The first marking unit is used to mark the state of the automation case corresponding to the execution result as executable and update it if the execution result is a preset result; the preset result is used to indicate the existence of a transaction type message.
[0148] The second marking unit marks the state of the automation case corresponding to the execution result as a maintenance pending state if the execution result is not the preset result.
[0149] In the embodiment of the present application, in the process of executing the automated case, there is no need to manually perform operations such as data acquisition, case creation, case execution, and case maintenance, thereby reducing labor costs. In addition, the latest transaction data is synchronously updated to the automated case by matching regular expressions. The data of the automated case is not solidified, so when the test environment data changes, the automated case can be executed normally, thereby improving the efficiency of executing the automated case.
[0150] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0151] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0152] The steps in the methods of the embodiments of the present application can be adjusted in order, combined, and deleted according to actual needs.
[0153] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0154] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
[0155] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An automated case generation method, characterized in that: The method comprises: Matching the streaming messages in the message log by using a pre-established regular expression to obtain the message content of the streaming messages, and extracting the transaction type messages from the message content; the streaming messages are used to represent messages transmitted in the form of continuous character strings; The streaming message is segmented by the pre-read interface document to obtain a message header and a message body of the streaming message; Generate a data dictionary according to the message of the transaction type, the message header, the message body and a preset message specification format; Filling the message content of the streaming message into the data dictionary; Generate and execute automation cases based on the populated data dictionary; The process of establishing the regular expression includes: Acquire message elements in the stream message; the message elements at least include a message type, a transaction code, a start identifier, and an end identifier; Concatenate the message type, the transaction code, the start identifier, and the end identifier to obtain a regular expression; The step of segmenting the stream message by using the pre-read interface document to obtain a message header and a message body of the stream message includes: Read the interface documentation; Generate n data fields based on the interface document; n is an integer greater than or equal to 1; The stream message is segmented by the n data fields to obtain a message header and a message body of the stream message.
2. The method according to claim 1, characterized in that The matching of the streaming messages in the message log by using a pre-established regular expression to obtain the message content of the streaming messages, and extracting the transaction type messages from the message content, includes: Determine the start identifier and the end identifier corresponding to the streaming message in the message log by using the regular expression; Marking the starting position of the streaming message by the start identifier; Marking the end position of the streaming message by the end marker; intercepting a message between a starting position of the stream message and an ending position of the stream message to obtain message content of the stream message; Determine the transaction type field in the message content by using the regular expression and the transaction code; Based on the transaction type field, a message of the transaction type is obtained.
3. The method according to claim 1, characterized in that After the automated case is generated based on the populated data dictionary and executed, the method further includes: Extracting the execution result of the automation case and determining the execution result; If the execution result is a preset result, the state of the automation case corresponding to the execution result is marked as executable and updated; the preset result is used to indicate the existence of a transaction type message; If the execution result is not the preset result, the state of the automation case corresponding to the execution result is marked as a maintenance pending state.
4. An automated case generation system, characterized in that: The system comprises: A matching unit, used to match the streaming messages in the message log by a pre-established regular expression, obtain the message content of the streaming messages, and extract the transaction type messages from the message content; the streaming messages are used to represent messages transmitted in the form of continuous character strings; A segmentation unit, configured to segment the stream message by using the pre-read interface document to obtain a message header and a message body of the stream message; A generating unit, configured to generate a data dictionary according to the message of the transaction type, the message header, the message body and a preset message specification format; A filling unit, used to fill the message content of the streaming message into the data dictionary; An execution unit, used for generating and executing automation cases based on the populated data dictionary; The matching unit of the regular expression establishment process includes: A first acquisition module, configured to acquire message elements in the stream message; the message elements at least include a message type, a transaction code, a start identifier, and an end identifier; A concatenation module, used for concatenating the message type, the transaction code, the start identifier and the end identifier to obtain a regular expression; The segmentation unit comprises: Reading module, used to read interface documents; A generating module, used to generate n data fields based on the interface document; wherein n is an integer greater than or equal to 1; The segmentation module is used to segment the streaming message according to the n data fields to obtain the message header and message body of the streaming message.
5. The system according to claim 4, characterized in that The matching unit comprises: A first determination module, used to determine the start identifier and the end identifier corresponding to the streaming message in the message log by using the regular expression; A first marking module, used for marking the starting position of the streaming message by using the start identifier; A second marking module, used for marking the end position of the streaming message by using the end mark; An interception module, used for intercepting the message between the starting position of the streaming message and the ending position of the streaming message to obtain the message content of the streaming message; A second determination module, configured to determine a transaction type field in the message content by using the regular expression and the transaction code; The second acquisition module is used to obtain a message of the transaction type based on the transaction type field.
6. The system according to claim 4, characterized in that Also includes: An extraction unit, used for extracting the execution result of the automation case and determining the execution result; A first marking unit, configured to mark and update the state of the automation case corresponding to the execution result as an executable state if the execution result is a preset result; The preset result is used to indicate the existence of a transaction type message; The second marking unit is configured to mark the state of the automation case corresponding to the execution result as a maintenance pending state if the execution result is not the preset result.
Citation Information
Patent Citations
Transaction message log analysis method and device
CN111061696A
Test script generation method, device, computer equipment and storage medium
CN111813680A
Cited By
Interface automation case test method, device and equipment and storage medium
CN120492346A