CN-116737566-B - Electronic document testing method and device, storage medium and electronic equipment
Abstract
The application discloses an electronic document testing method, an electronic document testing device, a storage medium and electronic equipment. The method comprises the steps of searching each generation request message Wen Moban based on identification information of a target test item to obtain a target generation request message template of an electronic document to be generated corresponding to the target test item, carrying out 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, carrying out data processing based on each target identification information and a preset download request message template to obtain a download request message corresponding to each test case of the target test item, and downloading each electronic document based on each download request message to obtain a test result. The application can improve the test efficiency of the electronic document generation process.
Inventors
- JIANG FANG
- XI YANYAN
- YANG JINMING
- Hao Yexuan
Assignees
- 中国人民财产保险股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230612
Claims (7)
- 1. An electronic document testing method, comprising: searching each generation request report Wen Moban based on the identification information of the target test item to obtain a target generation request report Wen Moban of the electronic document to be generated, which corresponds 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 all test cases of the target test item, and sending all the generation request messages to a system to be tested, so that the system to be tested generates electronic documents corresponding to all the test cases according to all the generation request messages, wherein all the generation request messages carry randomly generated target identification information; performing data processing based on the target identification information and a preset download request message template to obtain download request messages corresponding to the test cases of the target test item; downloading each electronic document based on each downloading request message to obtain a test result; The data processing is performed based on the preset parameter table of the target test item and the target generation request message template to obtain a generation request message corresponding to each test case of the target test item, which specifically comprises the following steps: searching each parameter table pre-stored in a preset storage area based on the identification information to obtain a target parameter table corresponding to the target test item; determining each first preset parameter needing parameter value replacement processing based on the target generation request message template; Performing replacement processing on each first preset parameter in the target generation request message template based on the target parameter table to obtain a generation request message corresponding to each test case of the target test item; the data processing is performed based on each target identification information and a preset download request message template to obtain a download request message corresponding to each test case of the target test item, which specifically comprises the following steps: determining a second preset parameter which needs to be subjected to parameter value replacement processing based on the preset download request message template; Replacing a second preset parameter in the downloading request message template based on each piece of target identification information to obtain a downloading request message of the electronic document corresponding to each test case of the target test item; downloading each electronic document based on each downloading request message to obtain a test result, wherein the method specifically comprises the following steps: transmitting each downloading request message to the system to be tested through a preset interface; Receiving information flow data corresponding to each download request message sent by the system to be tested; And carrying out data processing on each information stream data to obtain an electronic document in a target format corresponding to each information stream data so as to obtain the test result.
- 2. The method of claim 1, wherein the replacing 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 item specifically includes: determining the mapping relation between each first preset parameter and each field in the target parameter table; Reading parameter values corresponding to the first preset parameters in a target parameter table row by row based on the mapping relation; and respectively replacing each parameter value corresponding to each row in the target parameter table with each first preset parameter value in the target generation request message template to obtain a generation request message corresponding to each test case of the target test item.
- 3. The method of claim 1, wherein prior to performing data processing based on each of the target identification information and a preset target download request message template corresponding to a target test item, the method further comprises: receiving a first return status code of the system under test; when the first return state code does not meet the preset condition, generating an abnormal test result, and ending the test process; when the first return status code meets a preset condition, the electronic document generation information is stored in a preset database; and when the electronic document generation information fails to be stored, generating a test abnormal result, and ending the test process.
- 4. The method of claim 1, wherein prior to receiving information flow data corresponding to each of the download request messages sent by the system under test, the method further comprises: receiving a second return status code of the system under test; when the second return state code does not meet the preset condition, generating an abnormal test result, and ending the test process; And when the second return status code meets a preset condition, executing the receiving of the information flow data corresponding to each downloading request message sent by the system to be tested.
- 5. An electronic document testing apparatus for performing the electronic document testing method according to any one of claims 1 to 4, comprising: The searching module is used for searching each generation request report Wen Moban based on the identification information of the target test item to obtain a target generation request report Wen Moban of the electronic document to be generated, which corresponds to the target test item; The generation request message obtaining module is used for carrying out 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 all test cases of the target test item, and sending all the generation request messages to a system to be tested so that the system to be tested generates electronic documents corresponding to all the test cases according to all the generation request messages, wherein all the generation request messages carry randomly generated target identification information; the download request message obtaining module is used for carrying out data processing on the basis of the target identification information and a preset download request message template to obtain download request messages corresponding to the test cases of the target test item; And the downloading module is used for downloading each electronic document based on each downloading request message to obtain a test result.
- 6. A storage medium storing a computer program which, when executed by a processor, implements the steps of the electronic document testing method of any one of the preceding claims 1-4.
- 7. An electronic device comprising at least a memory, a processor, said memory having stored thereon a computer program, said processor, when executing the computer program on said memory, implementing the steps of the electronic document testing method according to any of the preceding claims 1-4.
Description
Electronic document testing method and device, storage medium and electronic equipment Technical Field The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for testing electronic documents, a storage medium, and an electronic device. Background Along with the development of information technology and the popularization of informationized digital life, more and more documents adopt an electronic mode, so that the transaction flow is simplified and the document cost is reduced. Along with popularization of electronic documents, the electronic document system has more and more test contents and higher test efficiency requirements. The traditional electronic document test work is usually carried out manually, and the test execution is long in time. Disclosure of Invention In view of the above, the invention provides a method, a device, a storage medium and an electronic device for testing electronic documents, which mainly aims to solve the problems that the electronic document testing work is performed manually and the test execution is long in time. In order to solve the above problems, the present application provides an electronic document testing method, including: searching each generation request report Wen Moban based on the identification information of the target test item to obtain a target generation request report Wen Moban of the electronic document to be generated, which corresponds 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 all test cases of the target test item, and sending all the generation request messages to a system to be tested, so that the system to be tested generates electronic documents corresponding to all the test cases according to all the generation request messages, wherein all the generation request messages carry randomly generated target identification information; performing data processing based on the target identification information and a preset download request message template to obtain download request messages corresponding to the test cases of the target test item; and downloading each electronic document based on each downloading request message to obtain a test result. Optionally, the data processing is performed based on the target parameter table of the target test item and the generation request message template to obtain a generation request message corresponding to each test case of the target test item, which specifically includes: searching each parameter table pre-stored in a preset storage area based on the identification information to obtain a target parameter table corresponding to the target test item; determining each first preset parameter needing parameter value replacement processing based on the target generation request message template; and replacing each first preset parameter in the target generation request message template based on the target parameter table to obtain a generation request message corresponding to each test case of the target test item. Optionally, the replacing processing is performed on each first preset parameter in the target generation request message template based on the target parameter table to obtain a generation request message corresponding to each test case of the target test item, which specifically includes: determining the mapping relation between each first preset parameter and each field in the target parameter table; Reading parameter values corresponding to the first preset parameters in a target parameter table row by row based on the mapping relation; and respectively replacing each parameter value corresponding to each row in the target parameter table with each first preset parameter value in the target generation request message template to obtain a generation request message corresponding to each test case of the target test item. Optionally, before performing data processing based on each target identification information and a preset target download request message template corresponding to a target test item, the method further includes: receiving a first return status code of the system under test; when the first return state code does not meet the preset condition, generating an abnormal test result, and ending the test process; when the first return status code meets a preset condition, the electronic document generation information is stored in a preset database; When the electronic document generation information fails to be stored, generating a test abnormal result, and ending the test process; optionally, the data processing is performed based on each target identification information and a preset download request message template to obtain a download request message corresponding to each test case of the target test item, which specifically includes: determini