An electronic single certificate testing method and device, a storage medium and an electronic device

By using automated electronic document testing methods and data processing to generate and download request message templates, the problem of time-consuming traditional manual testing is solved, thus improving testing efficiency.

CN116737566BActive Publication Date: 2026-05-05PEOPLE'S INSURANCE COMPANY OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PEOPLE'S INSURANCE COMPANY OF CHINA
Filing Date
2023-06-12
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Traditional electronic document testing relies on manual methods, resulting in long testing times and low efficiency.

Method used

By finding the generation request message template based on the identification information of the target test item, processing the data using a preset parameter table, generating a generation request message carrying random identification information, and automatically downloading the request message template, the electronic document testing is automated.

Benefits of technology

The process of testing electronic documents has been automated, improving testing efficiency, reducing manual intervention, and increasing testing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116737566B_ABST
    Figure CN116737566B_ABST
Patent Text Reader

Abstract

This application discloses an electronic document testing method, apparatus, storage medium, and electronic device. The method includes: searching for generation request message templates based on the identifier information of the target test item to obtain a target generation request message template for the electronic document to be generated corresponding to the target test item; performing data processing based on a preset parameter table of the target test item and the target generation request message template to obtain generation request messages corresponding to each test case of the target test item, wherein each generation request message carries randomly generated target identifier information; performing data processing based on the target identifier information and a preset download request message template to obtain download request messages corresponding to each test case of the target test item; and downloading each electronic document based on the download request messages to obtain test results. This application can improve the testing efficiency of the electronic document generation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an electronic document testing method, apparatus, storage medium, and electronic device. Background Technology

[0002] With the development of information technology and the popularization of digital life, more and more documents are being digitized, which simplifies transaction processes and reduces document costs. Along with the widespread adoption of electronic documents, the testing content for electronic document systems is increasing, and the requirements for testing efficiency are also rising. Traditional electronic document testing is usually conducted manually, which is time-consuming. Summary of the Invention

[0003] In view of this, the present invention provides an electronic document testing method, apparatus, storage medium and electronic device, the main purpose of which is to solve the problem that the current electronic document testing work is carried out manually and the test execution is time-consuming.

[0004] To address the aforementioned problems, this application provides an electronic document testing method, comprising:

[0005] Based on the identification information of the target test project, find the generation request message template of each generation request message template to obtain the target generation request message template of the electronic document to be generated corresponding to the target test project.

[0006] Data processing is performed based on the preset parameter table of the target test project and the target generation request message template to obtain the generation request message corresponding to each test case of the target test project, and each generation request message is sent to the system under test so that the system under test can generate electronic documents corresponding to each test case according to each generation request message. Each generation request message carries randomly generated target identification information.

[0007] Data processing is performed based on the target identification information and the preset download request message template to obtain the download request message corresponding to each test case of the target test project;

[0008] The electronic documents are downloaded based on the download request messages, and the test results are obtained.

[0009] Optionally, the step of processing data based on the target parameter table of the target test project and the generated request message template to obtain the generated request message corresponding to each test case of the target test project specifically includes:

[0010] Based on the identification information, search for each parameter table pre-stored in the preset storage area to obtain the target parameter table corresponding to the target test item;

[0011] Based on the target, a request message template is generated to determine the first preset parameters that need to be replaced.

[0012] Based on the target parameter table, each of the first preset parameters in the target generation request message template is replaced to obtain the generation request message corresponding to each test case of the target test project.

[0013] Optionally, the step of replacing each of the first preset parameters in the target generation request message template based on the target parameter table to obtain the generation request message corresponding to each test case of the target test project specifically includes:

[0014] Determine the mapping relationship between each of the first preset parameters and each field in the target parameter table;

[0015] Based on the mapping relationships described above, the parameter values ​​corresponding to the first preset parameters in the target parameter table are read line by line;

[0016] Replace each parameter value corresponding to each row in the target parameter table with each of the first preset parameter values ​​in the target generation request message template to obtain the generation request message corresponding to each test case of the target test project.

[0017] Optionally, before performing data processing based on the target identification information and the preset target download request message template corresponding to the target test item, the method further includes:

[0018] Receive the first return status code from the system under test;

[0019] When the first return status code does not meet the preset conditions, an abnormal test result is generated and the test process ends;

[0020] When the first return status code meets the preset conditions, the electronic document generation information is saved in the preset database;

[0021] If the electronic document generation information fails to be saved, an abnormal test result is generated, and the test process ends.

[0022] Optionally, the step of processing data based on the target identifier information and a preset download request message template to obtain download request messages corresponding to each test case of the target test project specifically includes:

[0023] Based on the preset download request message template, a second preset parameter that needs to be replaced is determined;

[0024] The second preset parameter in the download request message template is replaced based on the target identification information to obtain the download request message of the electronic document corresponding to each test case of the target test project.

[0025] Optionally, the step of downloading each electronic document based on each download request message to obtain test results specifically includes:

[0026] Each download request message is sent to the system under test through a preset interface;

[0027] Receive information stream data sent by the system under test corresponding to each of the download request messages;

[0028] Data processing is performed on each of the aforementioned information flow data to obtain electronic documents in the target format corresponding to each of the aforementioned information flow data, thereby obtaining the test results.

[0029] Optionally, before receiving the information stream data corresponding to each download request message sent by the system under test, the method further includes:

[0030] Receive the second return status code from the system under test;

[0031] When the second return status code does not meet the preset conditions, an abnormal test result is generated and the test process ends;

[0032] When the second return status code meets the preset conditions, the process of receiving the information stream data corresponding to each download request message sent by the system under test is executed.

[0033] To address the aforementioned problems, this application provides an electronic document testing device, comprising:

[0034] Search module: used to search for each generation request message template based on the identification information of the target test project, and obtain the target generation request message template of the electronic document to be generated corresponding to the target test project;

[0035] The request message generation module is used to process data based on the preset parameter table of the target test project and the target request message template to obtain the request message generation corresponding to each test case of the target test project, and send each request message generation to the system under test so that the system under test can generate electronic documents corresponding to each test case according to each request message generation. Each request message generation carries randomly generated target identification information.

[0036] Download request message acquisition module: used to process data based on the target identification information and the preset download request message template to obtain the download request message corresponding to each test case of the target test project;

[0037] Download module: Used to download each of the electronic documents based on the download request messages and obtain test results.

[0038] To address the aforementioned problems, this application provides a storage medium storing a computer program that, when executed by a processor, implements the steps of the aforementioned electronic document testing method.

[0039] To address the aforementioned problems, this application provides an electronic device, comprising at least a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the aforementioned electronic document testing method.

[0040] This application obtains generation request messages corresponding to each test case of the target test project by automatically replacing each first preset parameter in a pre-built generation request message template; it then obtains download request messages corresponding to each test case of the target test project by automatically replacing the second preset parameter in a pre-built download request message template using the target identification information carried in the generation request message; and finally, it downloads electronic documents based on these download request messages to obtain test results. The electronic document testing method in this application eliminates the need for manual searching of messages and manual replacement of the first preset parameters in the messages, thus automating the electronic document testing process and improving the testing efficiency of the electronic document generation process.

[0041] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0042] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0043] Figure 1 A flowchart illustrating an electronic document testing method provided in an embodiment of this application is shown.

[0044] Figure 2 A flowchart illustrating an electronic document testing method according to another embodiment of this application is shown;

[0045] Figure 3A structural block diagram of an electronic document testing device provided in another embodiment of this application is shown. Detailed Implementation

[0046] Various embodiments and features of this application are described herein with reference to the accompanying drawings.

[0047] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.

[0048] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0049] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.

[0050] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.

[0051] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.

[0052] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.

[0053] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.

[0054] This application provides an electronic document testing method, such as... Figure 1 As shown, it includes:

[0055] Step S101: Based on the identification information of the target test project, find each generation request message template to obtain the target generation request message template of the electronic document to be generated corresponding to the target test project;

[0056] In the specific implementation process of this step, in the property insurance application scenario, the target test items can be: vehicle insurance electronic document testing, non-vehicle insurance electronic document testing, etc.; the electronic documents can be: application form, policy, endorsement, etc.; this application provides electronic document generation request templates and electronic document download request templates corresponding to each test item. The format of the electronic document generation request templates and the electronic document download request templates can be XML format. This application does not restrict the format of the templates. The method of this application can search for each generation request message template according to the identification information of the target item to obtain the target generation request message template of the electronic document to be generated corresponding to the target item.

[0057] Step S102: Based on the preset parameter table of the target test project and the target generation request message template, perform data processing to obtain the generation request message corresponding to each test case of the target test project, and send each generation request message to the system under test so that the system under test can generate electronic documents corresponding to each test case according to each generation request message. Each generation request message carries randomly generated target identification information.

[0058] In this step, based on the identification information, the pre-stored parameter tables in the preset storage area are searched to obtain the target parameter table corresponding to the target test project. Each parameter table can be in Excel spreadsheet format or a configuration file table format. For example, if the target project identifier is "PDNAA", then the parameter tables corresponding to "PDNAA" are queried to find the target parameter table corresponding to the "PDNAA" project identifier. Based on the target generation request message template, the first preset parameters that need to be replaced are determined. Each first preset parameter is a parameter corresponding to a key field in the electronic document to be generated, such as parameters corresponding to fields like institution name, insurance type, terms, and liability. Based on the target parameter table, each first preset parameter in the target generation request message template is replaced to obtain the generation request message corresponding to each test case of the target test project. The replacement position of each first preset parameter can be set by pre-embedding variable placeholders in the generation request message template, for example, using a $ placeholder to indicate that the first preset parameter following it is being replaced. The first preset parameters in the target generation request message template are replaced with the parameter values ​​from the target parameter table to obtain the generation request message corresponding to each test case of the target test project. The generation request message carries randomly generated target identification information, which is the identification information of the electronic document generated based on the generation request message.

[0059] Step S103: Based on the target identification information and the preset download request message template, perform data processing to obtain the download request message corresponding to each test case of the target test project;

[0060] In this step, the download request message templates are located based on the target project's identification information to obtain the target download request message templates for each electronic document corresponding to the target test project. Based on these target download request message templates, a second preset parameter requiring parameter value replacement is determined. The second preset parameter in the download message template is then replaced based on the target identification information to obtain the download request message for each test case of the target test project. Specifically, the second preset parameter in the download message template is replaced with the target identification information carried in the target generation request message to obtain the download request message for each test case of the target test project. For example, when the current target test project is an insurance policy test, the target identification information is the insurance policy number. The second preset parameter in the download message template is replaced based on each insurance policy number to obtain the download request message for each test case of the target test project.

[0061] Step S104: Download each of the electronic documents based on each of the download request messages to obtain test results.

[0062] In this step, each download request message is sent to the system under test through a preset interface; information flow data corresponding to each download request message is received from the system under test; and data processing is performed on each information flow data to obtain an electronic document in the target format corresponding to each information flow data, so as to obtain the test result.

[0063] This application obtains generation request messages corresponding to each test case of the target test project by automatically replacing each first preset parameter in a pre-built generation request message template; it then obtains download request messages corresponding to each test case of the target test project by automatically replacing the second preset parameter in a pre-built download request message template using the target identification information carried in the generation request message; and finally, it downloads electronic documents based on these download request messages to obtain test results. The electronic document testing method in this application eliminates the need for manual searching and replacing of the first preset parameters in the messages, thus automating the electronic document testing process and improving testing efficiency.

[0064] Another embodiment of this application provides a method for testing electronic documents, such as... Figure 2 As shown, it includes:

[0065] Step S201: Based on the identification information of the target test project, find each generation request message template to obtain the target generation request message template of the electronic document to be generated corresponding to the target test project;

[0066] In the specific implementation process of this step, the target project can be: vehicle insurance electronic document testing, non-vehicle insurance electronic document testing, etc.; the electronic document can be an application form, policy, endorsement, etc.; this application provides electronic document generation request templates and electronic document download request templates corresponding to each test project. The format of the electronic document generation request templates and the electronic document download request templates can be XML format. This application does not restrict the format of the templates. The method of this application can search for each generation request message template according to the identification information of the target project to obtain the target generation request message template of the electronic document to be generated corresponding to the target project. Specifically, when the project identifier of the target project is "DAAinsure", it searches for each of the generation request templates to obtain the target generation request message template corresponding to "DAAinsure"; the identifier of the target generation request message template is IDP-DAAinsure.xml.

[0067] Step S202: Based on the identification information, search for each parameter table pre-stored in the preset storage area to obtain the target parameter table corresponding to the target test item;

[0068] In the specific implementation of this step, for example, when the target project identifier is "DAAinsure", the parameter tables are searched based on the project identifier to obtain the target parameter table corresponding to the project identifier "DAAinsure". To accurately locate the target parameter table, this application pre-names the target parameter table with the name corresponding to the target project identifier information, facilitating the search. For example, when the target project name is "NDAAinsure", the parameter tables are searched based on the project identifier "NDAAinsure" to obtain the target parameter table corresponding to the project identifier "DAAinsure", and so on.

[0069] Step S203: Based on the target, generate a request message template to determine each of the first preset parameters that need to be replaced;

[0070] In the specific implementation of this step, each of the first preset parameters corresponds to the parameters of the key fields in the electronic document to be generated, such as parameters corresponding to fields like institution name, insurance type, terms, and liability. Depending on the specific scenario, during the testing of some electronic documents, it may also be necessary to determine the third preset parameters that need to be replaced with random parameter values. These third preset parameters are parameters corresponding to non-key fields. For example, the third preset parameters could be date or other parameter information.

[0071] Step S204: Replace each of the first preset parameters in the target generation request message template based on the target parameter table to obtain the generation request message corresponding to each test case of the target test project, and send each generation request message to the system under test;

[0072] In this step, the mapping relationship between each of the first preset parameters and each field in the target parameter table is determined. For example, when the fields in the target parameter table are organization code (comCode), provincial organization code (makeCom), insurance product code (riskCode), document identification code (idenCode), and project platform code (projectCode), the mapping relationship between each of the first preset parameters in the target generation request message template and each of the aforementioned fields is determined. The replacement positions of each of the first preset parameters are set by pre-embedding variable placeholders in the request message template. A placeholder symbol ($) can be used to indicate that the subsequent first preset parameter needs to be replaced. Each of the first preset parameters can be one or more fields in the target parameter table. For example, when the first preset parameters are organization code (comCode) and insurance product code (riskCode), the mapping relationship between these two first preset parameters and the fields in the target parameter table corresponding to organization code (comCode) and insurance product code (riskCode) is determined. Based on the mapping relationships, the parameter values ​​corresponding to the first preset parameters in the target parameter table are read line by line; each parameter value in each row of the target parameter table is replaced with each of the first preset parameter values ​​in the target generation request message template to obtain the generation request message corresponding to each test case of the target test project, and each generation request message is sent to the system under test. The generation request message carries randomly generated target identification information, which is the identification information of the electronic document generated based on the generation request message.

[0073] Step S205: Receive the first return status code of the system under test; when the first return status code does not meet the preset conditions, generate an abnormal test result and end the test process;

[0074] In the specific implementation process of this step, when the generated request message is sent to the system under test, after successful transmission, the system under test will return a string of the first return status code. The preset condition can be a pre-constructed preset first return status code. When the first return status code does not meet the preset condition, an exception is thrown, an exception test result is generated, and the test process ends when the first return status code is different from the preset first return status code.

[0075] Step S206: When the first return status code meets the preset conditions, the electronic document generation information is saved in the preset database;

[0076] In this step, when the first return status code meets a preset condition, i.e., when the first return status code is the same as the preset first return status code, the electronic document generation information is saved in a preset database. The electronic document generation information includes: document name, document type, document generation success, date, and generation status log information.

[0077] Step S207: If the electronic document generation information fails to be saved, an abnormal test result is generated, and the test process ends;

[0078] In the specific implementation process of this step, if the electronic document generation information fails to be saved, an exception is thrown, a test exception result is generated, and the test process ends.

[0079] Step S208: Determine the second preset parameter that needs to be replaced based on the preset download request message template;

[0080] In the specific implementation process of this step, the second preset parameter needs to be replaced by the randomly generated target identification information carried in the generation request message. The target identification information is the identification information of the electronic document generated according to the generation request message. The replacement position of the second preset parameter can be set by pre-embedding variable placeholders in the download request message template. The $ placeholder flag can be used to replace the second preset parameter that follows.

[0081] Step S209: Replace the second preset parameter in the download message template based on the target identification information to obtain the download request message of the electronic document corresponding to each test case of the target test project;

[0082] In the specific implementation process of this step, the second preset parameter in the download message template is replaced with the target identifier information carried in the target generation request message to obtain the download request message of the electronic document corresponding to each test case of the target test project.

[0083] Step S210: Send each of the download request messages to the system under test through a preset interface;

[0084] In the specific implementation process, this step involves using the download request messages to call the preset electronic document download interface of the system under test to download the electronic documents.

[0085] Step S211: Receive the second return status code of the system under test;

[0086] In this step, the system under test receives a second return status code after sending each download request message to the system under test through a preset interface. The second return status code indicates either download success or download failure. This lays the foundation for generating an abnormal test result and ending the test process when the second return status code does not meet the preset conditions, and for receiving the information stream data corresponding to each download request message sent by the system under test when the second return status code meets the preset conditions.

[0087] Step S212: When the second return status code does not meet the preset conditions, generate an abnormal test result and end the test process;

[0088] In the specific implementation process of this step, if the second return status code does not meet the preset conditions, that is, if the second return status code is different from the preset second return status code, it proves that the electronic document download has failed, then an exception is thrown, an exception test result is generated, and the test process ends.

[0089] Step S213: When the second return status code meets the preset conditions, receive the information stream data sent by the system under test corresponding to each of the download request messages;

[0090] In the specific implementation of this step, when the second return status code meets the preset condition, that is, when the second return status code is the same as the preset second return status code, the electronic document is successfully downloaded, and then the information stream data corresponding to each download request message sent by the system under test is received.

[0091] Step S214: Perform data processing on each of the information flow data to obtain an electronic document in the target format corresponding to each of the information flow data, so as to obtain the test result.

[0092] In the specific implementation process of this step, the information flow data of the electronic documents corresponding to each test case is obtained by calling the preset interface of the system under test through the download request message. It is necessary to process the information flow data to obtain the electronic documents in the target format corresponding to each information flow data. The target format can be a PDF format electronic document. This application does not limit the format of the electronic document in order to obtain the test results.

[0093] This application obtains a generation request message template corresponding to the target test project through the target test project identification information. Variable placeholders are pre-embedded in the generation request message template. The first preset parameters after the pre-embedded variable placeholders in the request message template are replaced with parameter values ​​from the target parameter table corresponding to the target test project to obtain generation request messages corresponding to each test case of the target test project. Then, the second preset parameters in the preset download request template are replaced with the target identification information carried in the generation request message to generate the download request message for the electronic document. The process of obtaining the generation request message and download request message does not require manual searching of the generation request message and download request message, nor does it require manual replacement of the first and second preset parameters, thus automating the electronic document testing process and improving the testing efficiency of electronic documents.

[0094] Another embodiment of this application provides an electronic document testing device, such as... Figure 3 As shown, it includes:

[0095] Search module 1: used to search for each generation request message template based on the identification information of the target test project, and obtain the target generation request message template of the electronic document to be generated corresponding to the target test project;

[0096] Module 2 for obtaining request messages: It is used to process data based on the preset parameter table of the target test project and the target request message template to obtain the request messages corresponding to each test case of the target test project, and send each request message to the system under test so that the system under test can generate electronic documents corresponding to each test case according to each request message. Each request message carries randomly generated target identification information.

[0097] Download request message acquisition module 3: is used to process data based on the target identification information and the preset download request message template to obtain the download request message corresponding to each test case of the target test project;

[0098] Download module 4: Used to download each of the electronic documents based on the download request messages and obtain test results.

[0099] In specific implementation, the generation request message acquisition module 2 is specifically used to: search for each parameter table pre-stored in the preset storage area based on the identification information to obtain the target parameter table corresponding to the target test project; determine each first preset parameter that needs to be replaced based on the target generation request message template; and replace each first preset parameter in the target generation request message template based on the target parameter table to obtain the generation request message corresponding to each test case of the target test project.

[0100] In the specific implementation process, the generation request message acquisition module 2 is further used to: determine the mapping relationship between each of the first preset parameters and each field in the target parameter table; based on each mapping relationship, read the parameter values ​​corresponding to the first preset parameters in the target parameter table line by line; and replace each parameter value corresponding to each row in the target parameter table with each of the first preset parameter values ​​in the target generation request message template to obtain the generation request message corresponding to each test case of the target test project.

[0101] In specific implementation, the electronic document testing device further includes: a first return status code receiving module, which is specifically used for: receiving the first return status code of the system under test; generating an abnormal test result and ending the test process when the first return status code does not meet the preset conditions; saving the electronic document generation information in a preset database when the first return status code meets the preset conditions; and generating an abnormal test result and ending the test process when the electronic document generation information fails to be saved.

[0102] In the specific implementation process, the download request message acquisition module 3 is specifically used to: determine the second preset parameter that needs to be replaced based on the preset download request message template; replace the second preset parameter in the download request message template based on the target identification information to obtain the download request message of the electronic document corresponding to each test case of the target test project.

[0103] In the specific implementation process, the download module 4 is specifically used to: send each download request message to the system under test through a preset interface; receive information flow data corresponding to each download request message sent by the system under test; process each information flow data to obtain an electronic document in a target format corresponding to each information flow data, so as to obtain the test result.

[0104] In specific implementation, the electronic document testing device further includes: a second return status code receiving module, which is specifically used for: receiving the second return status code of the system under test; generating an abnormal test result and ending the test process when the second return status code does not meet the preset conditions; and executing the receiving of information stream data corresponding to each download request message sent by the system under test when the second return status code meets the preset conditions.

[0105] This application obtains generation request messages corresponding to each test case of the target test project by automatically replacing each first preset parameter in a pre-built generation request message template; it then obtains download request messages corresponding to each test case of the target test project by automatically replacing the second preset parameter in a pre-built download request message template using the target identification information carried in the generation request message; and finally, it downloads electronic documents based on these download request messages to obtain test results. The electronic document testing method in this application eliminates the need for manual searching and replacing of the first preset parameters in the messages, thus automating the electronic document testing process and improving testing efficiency.

[0106] Another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the following method steps:

[0107] Step 1: Based on the identification information of the target test project, find the generation request message templates of each generation request message to obtain the target generation request message template of the electronic document to be generated corresponding to the target test project;

[0108] Step 2: Based on the preset parameter table of the target test project and the target generation request message template, perform data processing to obtain the generation request message corresponding to each test case of the target test project, and send each generation request message to the system under test so that the system under test can generate electronic documents corresponding to each test case according to each generation request message. Each generation request message carries randomly generated target identification information.

[0109] Step 3: Based on the target identification information and the preset download request message template, perform data processing to obtain the download request message corresponding to each test case of the target test project;

[0110] Step 4: Download each of the electronic documents based on the download request messages to obtain the test results.

[0111] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0112] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0113] The specific implementation process of the above method steps can be found in the embodiment of the above electronic document testing method, which will not be repeated here.

[0114] This application obtains generation request messages corresponding to each test case of the target test project by automatically replacing each first preset parameter in a pre-built generation request message template; it then obtains download request messages corresponding to each test case of the target test project by automatically replacing the second preset parameter in a pre-built download request message template using the target identification information carried in the generation request message; and finally, it downloads electronic documents based on these download request messages to obtain test results. The electronic document testing method in this application eliminates the need for manual searching and replacing of the first preset parameters in the messages, thus automating the electronic document testing process and improving testing efficiency.

[0115] Another embodiment of this application provides an electronic device, which can be a server. The electronic device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the program is executed by the processor, it implements the functions or steps of an electronic document testing method on the server side.

[0116] In one embodiment, an electronic device is provided, which can be a client. The electronic device includes a processor, memory, a network interface, a display screen, and an input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with an external server via a network connection. When the program is executed by the processor, it implements the functions or steps of an electronic document testing method on the client side.

[0117] Another embodiment of this application provides an electronic device, including at least a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program in the memory, performs the following method steps:

[0118] Step 1: Based on the identification information of the target test project, find the generation request message templates of each generation request message to obtain the target generation request message template of the electronic document to be generated corresponding to the target test project;

[0119] Step 2: Based on the preset parameter table of the target test project and the target generation request message template, perform data processing to obtain the generation request message corresponding to each test case of the target test project, and send each generation request message to the system under test so that the system under test can generate electronic documents corresponding to each test case according to each generation request message. Each generation request message carries randomly generated target identification information.

[0120] Step 3: Based on the target identification information and the preset download request message template, perform data processing to obtain the download request message corresponding to each test case of the target test project;

[0121] Step 4: Download each of the electronic documents based on the download request messages to obtain the test results.

[0122] The specific implementation process of the above method steps can be found in the embodiments of any of the above CT image processing methods, and will not be repeated here.

[0123] This application obtains generation request messages corresponding to each test case of the target test project by automatically replacing each first preset parameter in a pre-built generation request message template; it then obtains download request messages corresponding to each test case of the target test project by automatically replacing the second preset parameter in a pre-built download request message template using the target identification information carried in the generation request message; and finally, it downloads electronic documents based on these download request messages to obtain test results. The electronic document testing method in this application eliminates the need for manual searching and replacing of the first preset parameters in the messages, thus automating the electronic document testing process and improving testing efficiency.

[0124] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.

Claims

1. A method for testing electronic documents, characterized in that, include: Based on the identification information of the target test project, find the generation request message template of each generation request message template to obtain the target generation request message template of the electronic document to be generated corresponding to the target test project. Data processing is performed based on the preset parameter table of the target test project and the target generation request message template to obtain the generation request message corresponding to each test case of the target test project, and each generation request message is sent to the system under test so that the system under test can generate electronic documents corresponding to each test case according to each generation request message. Each generation request message carries randomly generated target identification information. Data processing is performed based on the target identification information and the preset download request message template to obtain the download request message corresponding to each test case of the target test project; The electronic documents are downloaded based on the download request messages, and the test results are obtained. The process of processing data based on the preset parameter table of the target test project and the target generation request message template to obtain the generation request message corresponding to each test case of the target test project specifically includes: Based on the identification information, search for each parameter table pre-stored in the preset storage area to obtain the target parameter table corresponding to the target test item; Based on the target, a request message template is generated to determine the first preset parameters that need to be replaced. Based on the target parameter table, each of the first preset parameters in the target generation request message template is replaced to obtain the generation request message corresponding to each test case of the target test project. The step of processing data based on the target identifier information and the preset download request message template to obtain the download request message corresponding to each test case of the target test project specifically includes: Based on the preset download request message template, a second preset parameter that needs to be replaced is determined; The second preset parameter in the download request message template is replaced based on the target identification information to obtain the download request message of the electronic document corresponding to each test case of the target test project; The process of downloading each electronic document based on each download request message to obtain test results specifically includes: Each download request message is sent to the system under test through a preset interface; Receive information stream data sent by the system under test corresponding to each of the download request messages; Data processing is performed on each of the aforementioned information flow data to obtain electronic documents in the target format corresponding to each of the aforementioned information flow data, thereby obtaining the test results.

2. The method as described in claim 1, characterized in that, The step of replacing each of the first preset parameters in the target generation request message template based on the target parameter table to obtain the generation request message corresponding to each test case of the target test project specifically includes: Determine the mapping relationship between each of the first preset parameters and each field in the target parameter table; Based on the mapping relationships described above, the parameter values ​​corresponding to the first preset parameters in the target parameter table are read line by line; Replace each parameter value corresponding to each row in the target parameter table with each of the first preset parameter values ​​in the target generation request message template to obtain the generation request message corresponding to each test case of the target test project.

3. The method as described in claim 1, characterized in that, Before processing the data based on the target identification information and the preset target download request message template corresponding to the target test item, the method further includes: Receive the first return status code from the system under test; When the first return status code does not meet the preset conditions, an abnormal test result is generated and the test process ends; When the first return status code meets the preset conditions, the electronic document generation information is saved in the preset database; If the electronic document generation information fails to be saved, an abnormal test result is generated, and the test process ends.

4. The method as described in claim 1, characterized in that, Before receiving the information stream data corresponding to each download request message sent by the system under test, the method further includes: Receive the second return status code from the system under test; When the second return status code does not meet the preset conditions, an abnormal test result is generated and the test process ends; When the second return status code meets the preset conditions, the process of receiving the information stream data corresponding to each download request message sent by the system under test is executed.

5. An electronic document testing device, used to implement any one of the electronic document testing methods as described in claims 1 to 4, characterized in that, include: Search module: used to search for each generation request message template based on the identification information of the target test project, and obtain the target generation request message template of the electronic document to be generated corresponding to the target test project; The request message generation module is used to process data based on the preset parameter table of the target test project and the target request message template to obtain the request message generation corresponding to each test case of the target test project, and send each request message generation to the system under test so that the system under test can generate electronic documents corresponding to each test case according to each request message generation. Each request message generation carries randomly generated target identification information. Download request message acquisition module: used to process data based on the target identification information and the preset download request message template to obtain the download request message corresponding to each test case of the target test project; Download module: Used to download each of the electronic documents based on the download request messages and obtain test results.

6. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the electronic document testing method according to any one of claims 1-4.

7. An electronic device, characterized in that, It includes at least a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the electronic document testing method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Document generation method and device, electronic equipment and medium

    CN111679975A

  • Test data generation method and device, test method and storage medium

    CN115422068A