Test system based on UI automatic composite scene test case
By designing a test system based on UI automation composite scenario test cases, the problem of the inability to realize multi-user synchronization function interaction in the existing technology is solved, and an efficient test process is realized and testing efficiency is improved.
Patent Information
- Application Number
- CN202411845032.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-28
AI Technical Summary
The existing technology cannot realize synchronous function interaction between multiple users, resulting in low testing efficiency and greatly increases the risk of failure in single use case execution of UI automation scripts.
Design a test system based on UI automation composite scenario test cases, including test equipment management module, device driver creation module, UI automation script writing module, message queue service module and log system module, through these modules, the synchronization function interaction between multiple users is achieved.
It realizes synchronous function interaction between multiple users, simplifies the test process, reduces the repetition of UI automation scripts, greatly improves test efficiency and saves time, and improves the scalability of the system.
Smart Images

Figure CN119718940A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to a testing system based on UI automated composite scenario testing cases. Background Art
[0002] When UI automation involves complex scenarios, the corresponding use case points are generally subdivided according to the complex scenarios, and the complex scenarios are divided into multiple independent test cases. Each test case has clear input, expected output and verification steps. UI automation scripts are written according to the divided independent test cases, and the UI automation scripts are executed individually in sequence.
[0003] In the split test cases, UI automation cannot realize synchronous functional interaction between multiple users, and users can only be switched after logging out, which makes it impossible to simulate scenarios close to the actual situation. There are also a large number of use cases that rely on the preconditions that are the results of the execution of other use cases, resulting in different use cases repeatedly executing the same steps, which is not conducive to improving test efficiency and time saving, and greatly increases the risk of failure in the execution of a single use case of the UI automation script. Summary of the invention
[0004] The present invention provides a testing system based on UI automated composite scenario test cases, which is used to solve the defects in the prior art that synchronous functional interaction between multiple users cannot be realized, different use cases repeatedly execute the same steps, and the testing efficiency is low, and realizes synchronous functional interaction between multiple users when testing cases.
[0005] The present invention provides a test system based on UI automation composite scenario test cases, comprising:
[0006] A test device management module, used to start the number of test devices required for the target composite scenario test case, and install the same version of the application to be tested on the test devices;
[0007] A device driver creation module, used to select a test framework in combination with the platform and technology stack of the application to be tested, and to create a device driver corresponding to the test device according to the target composite scenario test case;
[0008] A UI automation script writing module is used to write UI automation scripts according to the test framework corresponding to the target composite scenario test case, encapsulate the steps of independent interactive operations and the steps of common execution, and assign them to the corresponding device driver for synchronous execution;
[0009] Message queue service module, used to send and receive the execution time of dependent events;
[0010] The operator in the test device is used to publish a message to the message queue service module after completing the steps, and other parties in the test device are used to subscribe to the message and determine whether to perform subsequent interactive operations based on the message until the target composite scenario test case completes the test.
[0011] According to a test system based on UI automated composite scenario test cases provided by the present invention, the operator in the test device is also used to calculate the estimated completion time of each key step after the key step is completed, and send the estimated completion time and the step completion message to the message queue service module;
[0012] The other parties in the test device are also used to parse out the timeout period according to the estimated completion time and the step completion message, and dynamically adjust the current waiting timeout according to the timeout period. When no message is received within the adjusted timeout period, the timeout processing logic is executed.
[0013] A test system based on UI automated composite scenario test cases provided by the present invention further includes a log system module, which is used to collect failed steps of the test device and record step exceptions captured by the test device into a log.
[0014] According to a test system based on UI automated composite scenario test cases provided by the present invention, the message queue service module is also used to synchronize messages indicating that execution steps of one of the test devices have failed to other test devices.
[0015] According to a test system based on UI automation composite scenario test cases provided by the present invention, the test device is also used to send the test results to the log system module.
[0016] According to a test system based on UI automation composite scenario test cases provided by the present invention, the log system module is also used to perform differentiated verification on each of the test devices in combination with the target composite scenario test cases, record the test results of each of the test devices in the UI automation script, and generate a test report.
[0017] The present invention provides a test system based on a UI automated composite scenario test case, which can automatically start the number of test devices required for the composite scenario test case to be tested, create the required number of device drivers, write a UI automated script according to the test framework corresponding to the composite scenario test case to be tested, encapsulate the steps of independent interactive operations and the steps of common execution, and assign them to the corresponding device drivers for synchronous execution. Since the test devices at each end are concurrent operations, operations closer to the actual scene can be simulated, and the consistency and interoperability of the entire function can be tested more comprehensively. In addition, the test system of the present invention sends and receives the execution time of dependent events in the form of a message queue, and the operator in the test device is used to publish a message to the message queue service module of the test system after completing the step, and other parties in the test device subscribe to the message. After receiving the message, it can be determined whether to perform subsequent interactive operations until the target composite scenario test case completes the test, thereby realizing synchronous functional interaction between multiple users when testing the case, simplifying the test process, reducing the repetition of UI automated scripts, and greatly improving test efficiency and saving time. In addition, the test system of the present invention improves scalability and can be more easily expanded to concurrent interactions between more machines and users. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a test flow diagram of a test system based on UI automated composite scenario test cases provided by the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] It should be noted that, in the description of the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0022] The present invention provides a test system based on UI automation composite scenario test cases, comprising:
[0023] A test device management module, used to start the number of test devices required for the target composite scenario test case, and install the same version of the application to be tested on the test devices;
[0024] A device driver creation module, used to select a test framework in combination with the platform and technology stack of the application to be tested, and to create a device driver corresponding to the test device according to the target composite scenario test case;
[0025] A UI automation script writing module is used to write UI automation scripts according to the test framework corresponding to the target composite scenario test case, encapsulate the steps of independent interactive operations and the steps of common execution, and assign them to the corresponding device driver for synchronous execution;
[0026] Message queue service module, used to send and receive the execution time of dependent events;
[0027] The operator in the test device is used to publish a message to the message queue service module after completing the steps, and other parties in the test device are used to subscribe to the message and determine whether to perform subsequent interactive operations based on the message until the target composite scenario test case completes the test.
[0028] Specifically, the test device management module of the test system first automatically starts the required number of test devices according to the script. The test devices can be virtual machines, simulators, or physical devices connected for testing. The same version of the application to be tested is automatically installed on the test devices according to the script to ensure that the devices can communicate with each other.
[0029] The device driver creation module selects a suitable test framework based on the platform (application server) and technology stack of the application to be tested, and creates the required number of device drivers according to the composite scenario test cases to be tested.
[0030] The UI automation script writing module uses the selected test framework to write UI automation scripts, encapsulates the steps that require independent interactive operations and public execution steps, and assigns them to the corresponding device drivers for synchronous execution.
[0031] The message queue service module sends and receives the execution time of dependent events by means of message queues. Specifically, in the interaction of multiple users and multiple devices, including the operator and other parties, when the operator performs an operation, it is necessary to feedback information to other parties, and other parties respond according to the information. In the present invention, all test devices subscribe to messages based on the message queue service. When the operator test device involved in the test case publishes a message to the message queue after completing the steps, the message queue service module will send it to the other party's test device. The other party's test device can decide whether to perform subsequent interactive operations based on the received message, and so on. Each test device executes the steps in sequence according to the UI automation script, thereby completing the test of the entire composite scenario test case.
[0032] Since the test devices at each end operate concurrently, synchronous functional interaction between multiple users can be achieved. Only one composite scenario test case is needed to write the UI automation script. There is no need to write the UI automation script by dividing the independent test cases as in the prior art, nor is there any need to repeatedly execute the same steps.
[0033] In some embodiments, the operator in the test device is further used to calculate the estimated completion time of each key step after the key step is completed, and send the estimated completion time and the step completion message to the message queue service module;
[0034] The other parties in the test device are also used to parse out the timeout period according to the estimated completion time and the step completion message, and dynamically adjust the current waiting timeout according to the timeout period. When no message is received within the adjusted timeout period, the timeout processing logic is executed.
[0035] In this embodiment, the test system also sets a dynamic timeout adjustment mechanism. After completing each key step, the operator's test device automatically calculates the estimated completion time of its key step, synchronizes the estimated completion time through the message queue service module, and the message queue service module synchronizes it to other test devices. As a result, other test devices can obtain the timeout duration based on the operator's estimated completion time and dynamically adjust the current waiting timeout duration.
[0036] The current waiting timeout period can be a timeout period preset by the tester, and the waiting timeout period can be set before writing the UI automation script.
[0037] In some embodiments, the test system further includes a log system module, which is used to collect failed steps of the test device and record the step exceptions captured by the test device into a log.
[0038] In this embodiment, failed steps are collected through a log system, step exceptions captured by each test device are recorded in a log, and failure messages are sent through a message queue to be synchronized to all test devices.
[0039] Correspondingly, the message queue service module is also used to synchronize the message of failure of the execution step of one of the test devices to other test devices.
[0040] In some embodiments, the test device is further used to send the test result to the log system module. The test device will automatically send the test result to the log system module for recording.
[0041] Correspondingly, the log system module is also used to perform differentiated verification on each of the test devices in combination with the target composite scenario test case, record the test results of each of the test devices in the UI automation script, and generate a test report.
[0042] Figure 1 FIG. 1 is a flow diagram of a test system based on a UI automated composite scenario test case according to an exemplary embodiment of the present invention. Figure 1 As shown, the device manager of the test system can start device A and device B according to the number of devices required for the composite scenario test case, and install the application to be tested. The test system will create a device driver in conjunction with the application server of the application to be tested, so that devices A and B can establish communication with the application server. Devices A and B execute steps according to the UI automation script written by the test system. In the figure, device A is the operator who executes a step, and device B needs to execute related steps based on the step execution result of device A. At this time, device B enters the waiting state and waits for device A to feedback a message. When device A, as the operator, completes the step, a message with the estimated completion time and step completion is sent to the message queue (i.e. Figure 1 The message queue will synchronize the estimated completion time and step completion message to device B. Device B will parse the timeout duration based on the message and dynamically adjust the current waiting timeout duration. If no message is received within the adjusted timeout duration, device B will execute the timeout processing logic. It can be understood that if device B does not receive the message that the step is completed by device A, the timeout processing logic will be executed according to the original waiting timeout duration.
[0043] The test system's log system can record the test results of device A and device B, and generate a test report based on the test results. In addition, the test system's log system will capture and record the steps that failed to be executed by device A and device B. At the same time, device A and device B will send the message of the step failure to the message queue service, and the message queue service will also synchronize the step failure messages of other devices to all devices (such as Figure 1 When a test device fails, you can perform a retest or other processing based on the failure information.
[0044] The test system based on the UI automated composite scenario test case provided by the present invention can automatically start the required number of test devices for the composite scenario test case to be tested, create the required number of device drivers, write UI automated scripts according to the test framework corresponding to the composite scenario test case to be tested, encapsulate the steps of independent interactive operations and the steps of public execution, and assign them to the corresponding device drivers for synchronous execution. Since the test devices at each end are concurrent operations, operations closer to the actual scene can be simulated, and the consistency and interoperability of the entire function can be tested more comprehensively. In addition, the test system of the present invention sends and receives the execution time of dependent events in the form of message queues. The operator in the test device is used to publish a message to the message queue service module of the test system after completing the step, and other parties in the test device subscribe to the message. After receiving the message, it can decide whether to perform subsequent interactive operations until the target composite scenario test case completes the test, thereby realizing synchronous functional interaction between multiple users when testing the case, simplifying the test process, reducing the repetition of UI automated scripts, and greatly improving test efficiency and saving time. In addition, the test system of the present invention improves scalability and can be more easily expanded to concurrent interactions between more machines and users.
[0045] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0046] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A test system based on UI automation composite scenario test cases, characterized in that: include: A test device management module, used to start the number of test devices required for the target composite scenario test case, and install the same version of the application to be tested on the test devices; A device driver creation module, used to select a test framework in combination with the platform and technology stack of the application to be tested, and to create a device driver corresponding to the test device according to the target composite scenario test case; A UI automation script writing module is used to write UI automation scripts according to the test framework corresponding to the target composite scenario test case, encapsulate the steps of independent interactive operations and the steps of common execution, and assign them to the corresponding device driver for synchronous execution; Message queue service module, used to send and receive the execution time of dependent events; The operator in the test device is used to publish a message to the message queue service module after completing the steps, and other parties in the test device are used to subscribe to the message and determine whether to perform subsequent interactive operations based on the message until the target composite scenario test case completes the test.
2. The test system based on UI automation composite scenario test case according to claim 1, characterized in that: The operator in the test device is also used to calculate the estimated completion time of each key step after the key step is completed, and send the estimated completion time and the step completion message to the message queue service module; The other parties in the test device are also used to parse out the timeout period according to the estimated completion time and the step completion message, and dynamically adjust the current waiting timeout according to the timeout period. When no message is received within the adjusted timeout period, the timeout processing logic is executed.
3. The test system based on UI automation composite scenario test case according to claim 1, characterized in that: It also includes a log system module, which is used to collect failed steps of the test device and record the step exceptions captured by the test device in a log.
4. The test system based on UI automation composite scenario test case according to claim 3 is characterized in that: The message queue service module is also used to synchronize the message that the execution step of one of the test devices fails to the other test devices.
5. The test system based on UI automation composite scenario test case according to claim 3 is characterized in that: The testing device is also used to send the test result to the log system module.
6. The test system based on UI automation composite scenario test case according to claim 5, characterized in that: The log system module is also used to perform differentiated verification on each of the test devices in combination with the target composite scenario test case, record the test results of each of the test devices in the UI automation script, and generate a test report.