DMDIS automatic testing method and device
By using the test engine process to synchronize test cases and mirroring processes in DMDIS tests, and generating fake HTTP requests to start the test, the problem of low automation and efficiency of DMDIS tests in the existing technology is solved, and more efficient automated testing is achieved.
Patent Information
- Application Number
- CN202411483941.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-23
AI Technical Summary
In the prior art, the degree of automation and testing efficiency of DMDIS tests are low, mainly due to the large number of test cases and the need to manually start the test and confirm the results.
It provides a DMDIS automated testing method, synchronizes test cases and mirroring processes to the DMDIS process to be tested through the test engine process, and generates a masquerading HTTP request, instructs the DMDIS process to start the test cases and mirroring processes, and generates and stores the test case execution results.
It realizes that the test cases and mirroring process are directly started through program code without the participation of testers, which improves the automation level and testing efficiency of DMDIS automation tests.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automated testing technology, and in particular to a DMDIS automated testing method and device. Background Art
[0002] DMDIS is a tool for data extraction, conversion, and loading for relational and non-relational databases, structured and unstructured data. When testing DMDIS, these three points are mainly tested. Therefore, a large number of test cases in the testing work are ultimately developed around these three points. In the actual testing process, the dependency relationship of these three components is usually drawn in one test process, and the running instructions of the test process are issued to DMDIS through the browser interface. After DMDIS receives the instruction, the loading component will read the data from the data source entity as input. The data flows through the conversion component and is processed into the data format required by the user and adapted to the data source entity referenced by the loading component. Finally, the loading component stores it in the target data source entity.
[0003] The DMDIS testing method in the prior art is that the test personnel issue test instructions to the browser, and then implement the test based on the test instructions. In addition, it is necessary to manually judge the test case execution results of the test case. As the types and number of DMDIS data sources increase, a large number of test cases are derived. The use of the prior art method of manually starting the test and manually confirming the test results will result in a low degree of automation in the DMDIS test, which in turn results in low test efficiency.
[0004] There is an urgent need to provide a DMDIS automated testing method and device to improve the automation level of DMDIS testing and improve testing efficiency. Summary of the invention
[0005] In view of this, it is necessary to provide a DMDIS automated testing method and device to solve the technical problem of low automation and test efficiency of DMDIS testing when there are many test cases in the prior art.
[0006] On the one hand, in order to solve the above technical problems, the present invention provides a DMDIS automated testing method, comprising: Synchronize test cases and mirror processes to the DMDIS process to be tested based on the test engine process; Generate a fake HTTP request based on the test engine process, and instruct the DMDIS process to be tested to start the test case and the mirror process based on the fake HTTP request, generate a test case execution result, and store the test case execution result; The mirror process is used to verify whether the output of the test case is the expected output.
[0007] In a possible implementation, synchronizing the test case and the mirror process to the DMDIS process to be tested based on the test engine process includes: The test engine process initiates a synchronization instruction, and when the synchronization process receives the synchronization instruction, the test cases and mirror processes in the baseline library process are synchronized to the DMDIS process to be tested.
[0008] In a possible implementation, the generating of a fake HTTP request based on the test engine process includes: Obtain the test case ID and base URL address of the test case; Concatenate the test case ID and the basic URL address to generate a unique URL; The fake HTTP request indication is generated based on the unique URL.
[0009] In a possible implementation, the generating the disguised HTTP request indication based on the unique URL includes: Use selenium to simulate logging into the DMDIS process to be tested; Obtaining the login session returned after the DMDIS process to be tested successfully logs in; Obtain a login token from the login session, and concatenate the login token into the request header; The disguised HTTP request indication is generated based on the request header and the unique URL.
[0010] In a possible implementation, instructing the DMDIS process to be tested to start the test case and the mirror process based on the fake HTTP request to generate the test case execution result includes: Instructing the DMDIS process to be tested to start the test case based on the fake HTTP request, and determining whether the test case is executed successfully; When the test case is successfully executed, the mirror process is started, and the test case execution result is generated based on the mirror process.
[0011] In a possible implementation, determining whether the test case is executed successfully includes: Continuously querying the execution status of the test case based on the execution ID of the test case; the execution status includes waiting state, cancel state, success state and failure state; Determine whether the execution state changes to the success state within a preset time, and if so, the test case is executed successfully.
[0012] In a possible implementation manner, storing the test case execution result includes: Storing the test case execution result in a preset data structure in the memory of the test engine process; The xlwt module of Python is called to write the test case execution results into a table, generate a result table, and send the result table to an FTP server for archiving.
[0013] In a possible implementation, the test engine process includes a first test engine process and a second test engine process, and the DMDIS automated testing method further includes: Before the first test engine process starts the test case, judging whether the test case is used by the second test engine process based on the global test case lock record table; When the test case is not used by the second test engine process, the first test engine process starts and executes the test case; When the first test engine process executes the test case, the test case is added to the global test case lock record table; when the first test engine process completes executing the test case, the test case is deleted from the global test case lock record table.
[0014] In a possible implementation, before synchronizing the test case and the mirror process to the DMDIS process to be tested based on the test engine process, the process includes: Based on multiple preset scheduling times in the Jenkins continuous integration process, the test engine process is called and started at each preset scheduling time.
[0015] On the other hand, the present invention also provides a DMDIS automatic testing device, comprising: A synchronization unit, used to synchronize the test cases and mirror processes to the DMDIS process to be tested based on the test engine process; An automated testing unit, configured to generate a fake HTTP request based on the test engine process, and instruct the DMDIS process to be tested to start the test case and the mirror process based on the fake HTTP request, generate a test case execution result, and store the test case execution result; The mirror process is used to verify whether the output of the test case is the expected output.
[0016] The beneficial effects of the present invention are as follows: the DMDIS automated testing method provided by the present invention can realize the direct startup of test cases and mirror processes through program codes by generating fake HTTP requests based on the test engine process, without the need for tester participation, thereby improving the automation level of DMDIS automated testing and improving the testing efficiency of DMDIS.
[0017] Furthermore, during the testing process of the test case, the present invention also starts a mirror process, through which it is possible to verify whether the output of the test case is the expected output, without the need for the tester to manually verify or judge the output of the test case, thereby further improving the degree of automation of the DMDIS automated test and thus further improving the testing efficiency of the DMDIS. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A schematic flow chart of an embodiment of the DMDIS automated testing method provided by the present invention; Figure 2 A schematic diagram of an embodiment of a typical test case provided by the present invention; Figure 3 A schematic diagram of an embodiment of a typical mirroring process provided by the present invention; Figure 4 The present invention Figure 1 A schematic diagram of an embodiment of the process of generating a disguised HTTP request in step S102; Figure 5 The present invention Figure 4 A schematic flow chart of an embodiment of step S403; Figure 6 The present invention Figure 1 A schematic diagram of an embodiment of a flow chart of generating a test case execution result in step S102; Figure 7 The present invention Figure 6 A schematic flow chart of an embodiment of step S601; Figure 8 The present invention Figure 1 A schematic diagram of an embodiment of storing the test case execution result in step S102; Fig. 9 A schematic diagram of a flow chart of an embodiment of applying a global use case lock provided by the present invention; Fig.10 A schematic structural diagram of an embodiment of a DMDIS automated testing device provided by the present invention; Fig.11 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0020] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0021] It should be understood that the schematic drawings are not drawn to scale. The flowchart used in the present invention shows the operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flowchart can be implemented out of order, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present invention, can add one or more other operations to the flowchart, and can also remove one or more operations from the flowchart. Some of the block diagrams shown in the accompanying drawings are functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.
[0022] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0023] The present invention provides a DMDIS automatic testing method and device, which are respectively described below.
[0024] Figure 1 A schematic flow chart of an embodiment of the DMDIS automated testing method provided by the present invention is as follows: Figure 1 As shown, the DMDIS automated testing method includes: S101, synchronizing the test case and the mirror process to the DMDIS process to be tested based on the test engine process; S102, generating a fake HTTP request based on the test engine process, and instructing the DMDIS process to be tested to start a test case and a mirror process based on the fake HTTP request, generating a test case execution result, and storing the test case execution result; Among them, the mirror process is used to verify whether the output of the test case is the expected output.
[0025] It should be noted that in order to improve the comprehensiveness of DMDIS testing, test cases and mirror processes should cover all basic functions of DMDIS.
[0026] A typical test example is Figure 2 As shown, it includes a data reading component, a data conversion component and a data loading component, and the data loading component includes the expected output of the test case.
[0027] Among them, a typical mirroring process is as follows Figure 3 As shown, the mirror process includes a data comparison component, which is used to determine whether the output of the test case is consistent with the expected output. When the output of the test case is inconsistent with the expected output, the test case is recorded in the decision table. The test engine process determines whether the test case being executed is in the decision table. If it is in the decision table, it determines whether the output of the test case is consistent with the expected output. When the output of the test case is inconsistent with the expected output, the test is determined to have failed, and the test case is deleted from the decision table. If the test case being executed is not in the decision table, the test is determined to have passed.
[0028] Among them, the data comparison component is a member of the data conversion component.
[0029] Compared with the prior art, the DMDIS automated testing method provided in the embodiment of the present invention can realize the direct startup of test cases and mirror processes through program codes by generating fake HTTP requests based on the test engine process, without the participation of testers, thereby improving the automation level of DMDIS automated testing and improving the testing efficiency of DMDIS.
[0030] Furthermore, during the testing process of the test case, the embodiment of the present invention also starts a mirror process, through which it is possible to verify whether the output of the test case is the expected output, without the need for the tester to manually verify or judge the output of the test case, thereby further improving the degree of automation of the DMDIS automated test and thus further improving the testing efficiency of the DMDIS.
[0031] In some embodiments of the present invention, step S101 includes: The test engine process initiates a synchronization instruction. When the synchronization process receives the synchronization instruction, it synchronizes the test cases and mirror processes in the baseline library process to the DMDIS process to be tested.
[0032] Specifically, when the synchronization process receives the synchronization indication, it packages the test cases and mirror processes in the baseline library process to generate a data packet, and then sends the data packet to the DMDIS to be tested, and then unpacks the data packet to obtain the test cases and mirror processes.
[0033] The DMDIS process that stores the stable versions of test cases and mirror processes is called the baseline library process.
[0034] It should be understood that the synchronization process itself does not have data backup or restore functions. What it does is to call the data backup and restore functions, data download and upload functions of DMDIS itself.
[0035] In some embodiments of the present invention, Figure 4 As shown, the step S102 of generating a fake HTTP request based on the test engine process includes: S401, obtain the test case ID and basic URL address of the test case; S402: Concatenate the test case ID and the basic URL address to generate a unique URL; S403: Generate a disguised HTTP request instruction based on the unique URL.
[0036] Among them, the test engine process is based on the HTTP protocol.
[0037] It should be noted that the test engine process needs to first obtain the metadata of all test cases and mirror processes, that is, the names and IDs of all test cases and mirror processes form a list. To this end, it needs to communicate with the baseline library process, and the metadata of the baseline library process is equivalent to the metadata of the DMDIS process to be tested; secondly, the test engine process must also know the request body format, which is obtained in advance by the test engineer from DMDIS and hard-coded in the test engine process.
[0038] In some embodiments of the present invention, Figure 5 As shown, step S403 includes: S501, use selenium to simulate logging into the DMDIS process to be tested; S502, obtaining the login session returned after the DMDIS process to be tested successfully logs in; S503, obtaining the login token in the login session, and concatenating the login token to the request header; S504: Generate a disguised HTTP request indication based on the request header and the unique URL.
[0039] Wherein, selenium is a tool for simulating browser operation. The browser in the embodiment of the present invention is Chrome browser.
[0040] It should be noted that step S504 specifically includes: using Python's requests network communication module, carrying a request header, and using a unique URL to send an HTTP request instruction to the DMDIS process to be tested.
[0041] It should also be noted that after the DMDIS process to be tested receives the HTTP request instruction, it will assign an execution ID (executeId) to the current test case and pass the execution ID back to the test engine process.
[0042] Then, only the execution ID needs to be stored in the determination table, and the execution ID is used to determine whether the test case has passed the test.
[0043] Since the mirror process is to compare the output of the test case with the expected output, that is, the output needs to be obtained based on the test case execution, in order to avoid invalid execution of the mirror process, in some embodiments of the present invention, such as Figure 6 As shown, in step S102, based on the fake HTTP request, the DMDIS process to be tested is instructed to start the test case and the mirror process, and the test case execution result is generated, including: S601, instructing the DMDIS process to be tested to start a test case based on a fake HTTP request, and determining whether the test case is executed successfully; S602: When the test case is successfully executed, the mirror process is started, and the test case execution result is generated based on the mirror process.
[0044] The embodiment of the present invention starts the mirror process only after judging that the test case is executed successfully, thereby avoiding invalid start of the mirror process and reducing the load in the DMDIS automated test process.
[0045] It should be noted that if the mirroring process fails to run, the test result of the test case will also be directly judged as failure.
[0046] In some embodiments of the present invention, Figure 7 As shown, the step S601 of determining whether the test case is successfully executed includes: S701, continuously query the execution status of the test case based on the execution ID of the test case; the execution status includes waiting state, cancel state, success state and failure state; S702: Determine whether the execution state changes to a success state within a preset time. If so, the test case is executed successfully.
[0047] The embodiment of the present invention confirms whether a test case is successfully executed through parameters in two dimensions, namely, time and status, thereby improving the timeliness and efficiency of DMDIS automated testing.
[0048] In some embodiments of the present invention, Figure 8 As shown, the step S102 of storing the test case execution result includes: S801, storing the test case execution result in the memory of the test engine process in a preset data structure; S802. Call the xlwt module of Python to write the test case execution results into a table, generate a result table, and send the result table to an FTP server for archiving.
[0049] The embodiment of the present invention integrates the test case execution results into an Excel file for easy archiving, thereby realizing the archiving of numerous test case execution results, facilitating subsequent analysis of the automated test results, and providing guidance for subsequent maintenance and upgrade of the DMDIS.
[0050] Among them, the xlwt module is an extension module in Python specifically used for writing Excel, which can realize artificial functions such as creating forms, writing to specified cells, and specifying cell styles. That is, the test case execution results stored in the preset data structure can be stored as Excel files.
[0051] The preset data structure may be a data structure composed of a test case ID, a result, and a failure reason when the result is a failure.
[0052] Among them, FTP server (File Transfer Protocol Server) is a computer that provides file storage and access services on the Internet, and provides services according to the FTP protocol. Simply put, a server that supports the FTP protocol is an FTP server.
[0053] In the case of multi-version parallel testing, since all test cases rely on the same set of data sources, conflicts may occur. In order to resolve such conflicts, in some embodiments of the present invention, the test engine process includes a first test engine process and a second test engine process corresponding to different versions of the DMDIS process to be tested. Fig. 9 As shown, the DMDIS automated testing method further includes: S901, before the first test engine process starts the test case, determine whether the test case is used by the second test engine process based on the global test case lock record table; S902: When the test case is not used by the second test engine process, the first test engine process starts the test case; S903. When the first test engine process executes the test case, the test case is added to the global test case lock record table. When the first test engine process completes executing the test case, the test case is deleted from the global test case lock record table.
[0054] The embodiment of the present invention sets a global test case lock so that the same test case can only be used by one test engine and cannot be used by two test engine processes at the same time, thereby avoiding conflicts and improving the orderliness and reliability of the DMDIS automated test process.
[0055] Since in some practical application scenarios, it is necessary to repeatedly start the test engine process to perform automated testing, to achieve this purpose, in some embodiments of the present invention, before step S101, the following is further included: Based on multiple preset scheduling times in the Jenkins continuous integration process, the test engine process is called and started at each preset scheduling time.
[0056] By setting the Jenkins continuous integration process, the embodiment of the present invention can call and start the test engine process at each preset scheduling time, realize repeated calling and execution of steps S101-S102, and thus realize repeated automated testing in an unattended state, further improving the automation level and efficiency of DMDIS automated testing.
[0057] The Jenkins continuous integration process includes multiple scheduled tasks, each of which is started at a preset scheduling time, and each of which is a test step in steps S101-S102.
[0058] In a specific embodiment of the present invention, the DMDIS automated testing method is specifically as follows: the Jenkins continuous integration process executes a scheduled task, repeatedly starts the test engine process, and the test engine process notifies the test case synchronization process to synchronize the test cases and mirror processes on the baseline library process to the DMDIS process to be tested, so that the DMDIS process to be tested replicates the test cases and mirror processes on the baseline library process. Then instruct the Chrome browser process to log in to the DMDIS service and obtain a login token. Then call the Python Requests module to forge an HTTP request to instruct the DMDIS process to be tested to start the test case, and continue to inquire about the running status of all its test cases. If the test case is executed successfully, the mirror process is instructed to perform the result verification work, and the test case execution results of all test cases are stored in a specific data structure. At the same time, the global case lock process is notified to lock the test case being executed and unlock the test case that has been executed. After the test case queue composed of the test case is consumed, the structure data of the test case execution result placed in the memory is read, and a test report is generated and sent to the test report storage process.
[0059] In order to better implement the DMDIS automated testing method in the embodiment of the present invention, based on the DMDIS automated testing method, the embodiment of the present invention also provides a DMDIS automated testing device, such as Fig.10 As shown, the DMDIS automatic test device 1000 includes: A synchronization unit 1001 is used to synchronize the test cases and the mirror process to the DMDIS process to be tested based on the test engine process; The automated testing unit 1002 is used to generate a fake HTTP request based on the test engine process, and instruct the DMDIS process to be tested to start the test case and the mirror process based on the fake HTTP request, generate the test case execution result, and store the test case execution result; Among them, the mirror process is used to verify whether the output of the test case is the expected output.
[0060] The DMDIS automated testing device 1000 provided in the above embodiment can implement the technical solution described in the above DMDIS automated testing method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above DMDIS automated testing method embodiment, which will not be repeated here.
[0061] like Fig.11 As shown, the present invention also provides an electronic device 1100. The electronic device 1100 includes a processor 1101, a memory 1102 and a display 1103. Fig.11 Only some components of the electronic device 1100 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0062] In some embodiments, the processor 1101 may be a central processing unit (CPU), a microprocessor or other data processing chip, and is used to run program codes or process data stored in the memory 1102, such as the DMDIS automated testing method of the present invention.
[0063] In some embodiments, the processor 1101 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 1101 may be local or remote. In some embodiments, the processor 1101 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
[0064] In some embodiments, the memory 1102 may be an internal storage unit of the electronic device 1100, such as a hard disk or memory of the electronic device 1100. In other embodiments, the memory 1102 may also be an external storage device of the electronic device 1100, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 1100.
[0065] Furthermore, the memory 1102 may include both an internal storage unit of the electronic device 1100 and an external storage device. The memory 1102 is used to store application software installed in the electronic device 1100 and various data.
[0066] In some embodiments, the display 1103 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 1103 is used to display information of the electronic device 1100 and to display a visual user interface. The components 1101-1103 of the electronic device 1100 communicate with each other via a system bus.
[0067] In some embodiments of the present invention, when the processor 1101 executes the DMDIS automated test program in the memory 1102, the following steps may be implemented: Synchronize test cases and mirror processes to the DMDIS process to be tested based on the test engine process; Generate a fake HTTP request based on the test engine process, and instruct the DMDIS process to be tested to start the test case and the mirror process based on the fake HTTP request, generate the test case execution result, and store the test case execution result; Among them, the mirror process is used to verify whether the output of the test case is the expected output.
[0068] It should be understood that: when the processor 1101 executes the DMDIS automatic test program in the memory 1102, in addition to the above functions, other functions may also be implemented, and details may refer to the description of the above corresponding method embodiments.
[0069] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 1100 mentioned. The electronic device 1100 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices. It should also be understood that in some other embodiments of the present invention, the electronic device 1100 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (such as a touch panel).
[0070] Accordingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, the steps or functions in the DMDIS automated testing method provided by the above-mentioned method embodiments can be implemented.
[0071] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0072] The above is a detailed introduction to a DMDIS automated testing method and device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A DMDIS automated testing method, characterized in that: include: Synchronize test cases and mirror processes to the DMDIS process to be tested based on the test engine process; Generate a fake HTTP request based on the test engine process, and instruct the DMDIS process to be tested to start the test case and the mirror process based on the fake HTTP request, generate a test case execution result, and store the test case execution result; The mirror process is used to verify whether the output of the test case is the expected output.
2. The DMDIS automated testing method according to claim 1, characterized in that: The step of synchronizing the test cases and the mirror process to the DMDIS process to be tested based on the test engine process includes: The test engine process initiates a synchronization instruction, and when the synchronization process receives the synchronization instruction, the test cases and mirror processes in the baseline library process are synchronized to the DMDIS process to be tested.
3. The DMDIS automated testing method according to claim 1, characterized in that: The generating of a fake HTTP request based on the test engine process includes: Obtain the test case ID and base URL address of the test case; Concatenate the test case ID and the basic URL address to generate a unique URL; The fake HTTP request indication is generated based on the unique URL.
4. The DMDIS automated testing method according to claim 3, characterized in that: The generating the disguised HTTP request indication based on the unique URL comprises: Use selenium to simulate logging into the DMDIS process to be tested; Obtaining the login session returned after the DMDIS process to be tested successfully logs in; Obtain a login token from the login session, and concatenate the login token into the request header; The disguised HTTP request indication is generated based on the request header and the unique URL.
5. The DMDIS automated testing method according to claim 1, characterized in that: The instructing the DMDIS process to be tested to start the test case and the mirror process based on the fake HTTP request to generate the test case execution result includes: Instructing the DMDIS process to be tested to start the test case based on the fake HTTP request, and determining whether the test case is executed successfully; When the test case is successfully executed, the mirror process is started, and the test case execution result is generated based on the mirror process.
6. The DMDIS automated testing method according to claim 5, characterized in that: Determining whether the test case is executed successfully includes: Continuously querying the execution status of the test case based on the execution ID of the test case; the execution status includes waiting state, cancel state, success state and failure state; Determine whether the execution state changes to the success state within a preset time, and if so, the test case is executed successfully.
7. The DMDIS automated testing method according to claim 1, characterized in that: The storing of the test case execution result includes: Storing the test case execution result in a preset data structure in the memory of the test engine process; The xlwt module of Python is called to write the test case execution results into a table, generate a result table, and send the result table to an FTP server for archiving.
8. The DMDIS automated testing method according to claim 1, characterized in that: The test engine process includes a first test engine process and a second test engine process, and the DMDIS automated testing method further includes: Before the first test engine process starts the test case, judging whether the test case is used by the second test engine process based on the global test case lock record table; When the test case is not used by the second test engine process, the first test engine process starts and executes the test case; When the first test engine process executes the test case, the test case is added to the global test case lock record table; when the first test engine process completes executing the test case, the test case is deleted from the global test case lock record table.
9. The DMDIS automated testing method according to claim 1, characterized in that: Before synchronizing the test cases and the mirror process to the DMDIS process to be tested based on the test engine process, the method further includes: Based on multiple preset scheduling times in the Jenkins continuous integration process, the test engine process is called and started at each preset scheduling time.
10. A DMDIS automated testing device, characterized in that: include: A synchronization unit, used to synchronize the test cases and mirror processes to the DMDIS process to be tested based on the test engine process; An automated testing unit, configured to generate a fake HTTP request based on the test engine process, and instruct the DMDIS process to be tested to start the test case and the mirror process based on the fake HTTP request, generate a test case execution result, and store the test case execution result; The mirror process is used to verify whether the output of the test case is the expected output.
Citation Information
Patent Citations
Program issuing method, device and system
CN104834602A
Operating system testing method and device
CN106294157A
Test scheduling method and related equipment
CN111078534A
Automatic testing method, device and equipment based on remote control vehicle and medium
CN115963810A
Method and apparatus for web-based control of a web-based workload simulation
US6522995B1