UI test data generation method, apparatus, equipment, and readable storage medium
By introducing a preset mapping relationship into UI testing to automatically obtain the variable values of interface test cases, the inefficiency and poor maintainability caused by manually selecting interface test cases in existing technologies are solved, thus achieving full-process automation and improved accuracy of UI testing.
Patent Information
- Application Number
- CN201910421677.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-17
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2039-05-17
AI Technical Summary
The existing UI testing process requires manual selection of the corresponding interface test cases for UI test cases. The lack of configuration mapping management results in poor maintainability of test cases, making it difficult for newcomers to get started quickly. Furthermore, the interface test case result data needs to be filled in manually, which makes it impossible to achieve full automation and leads to low efficiency.
By automatically obtaining the correspondence between UI test cases and interface test cases through preset mapping relationships, the entire process is automated, and variable values are automatically obtained and mapped, reducing manual intervention.
It has achieved full automation of UI testing, improving testing efficiency, accuracy and maintainability, reducing human error, and improving the execution efficiency of test cases.
Smart Images

Figure CN110134612B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, and readable storage medium for generating UI test data. Background Technology
[0002] With the development of computer technology, more and more technologies (big data, distributed systems, blockchain, artificial intelligence, etc.) are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher demands are also being placed on technology.
[0003] After application development is complete, UI (User Interface) testing is required to identify and address issues promptly. Large-scale application service projects often involve external interfaces with multiple third-party software to facilitate data interaction with different business systems; therefore, interface testing is frequently necessary alongside UI testing.
[0004] In the existing UI testing workflow, manual selection of interface test cases corresponding to UI test cases is required. The entire test case management is not based on configuration mapping, relying solely on the tester's business experience. This results in poor test case maintainability. If a new tester needs to prepare data again, they may not immediately know which interface test cases to execute. Furthermore, the data returned after the interface test cases are executed requires manual input of the necessary variable values into the UI test cases. This lack of end-to-end automation leads to errors during the writing of numerous test cases and low test case execution efficiency. Summary of the Invention
[0005] The main objective of this invention is to provide a method, apparatus, device, and readable storage medium for generating UI test data, aiming to improve the efficiency and accuracy of UI testing through full-process automation.
[0006] To achieve the above objectives, the present invention provides a UI test data generation method, which includes the following steps:
[0007] Upon receiving an execution instruction to execute a UI test case, the identifier of the interface test case that maps to the identifier of the UI test case is obtained according to a preset mapping relationship;
[0008] The identifier of the interface test case is sent to the server so that the server can execute the interface test case and return the value of the first variable corresponding to the first variable name of the interface test case;
[0009] Based on the first variable name and first variable value of the interface test case, obtain the second variable value corresponding to the second variable name of the UI test case, and use the second variable name and corresponding second variable value of the UI test case as test data.
[0010] Optionally, before the step of obtaining the identifier of the interface test case that maps to the identifier of the UI test case according to a preset mapping relationship when receiving the execution instruction for executing the UI test case, the method further includes:
[0011] Upon receiving a mapping relationship setting instruction, obtain the identifiers of the UI test cases and the interface test cases carried in the mapping relationship setting instruction;
[0012] The identifiers of the UI test cases and the identifiers of the interface test cases are associated and saved as a preset mapping relationship.
[0013] Optionally, after the step of associating and saving the identifiers of the UI test cases and the identifiers of the interface test cases as a preset mapping relationship, the method further includes:
[0014] Upon receiving a variable name query instruction, the first variable name of the interface test case is obtained and displayed on the current page for testers to view;
[0015] Upon receiving a variable name setting instruction, the variable name carried by the variable name setting instruction is set as the second variable name of the UI test case, wherein the first variable name includes the second variable name.
[0016] Optionally, the step of obtaining the second variable value corresponding to the second variable name of the UI test case based on the first variable name and the first variable value of the interface test case includes:
[0017] The first variable name and the first variable value of the interface test case are associated and stored in the variable pool;
[0018] The second variable value corresponding to the second variable name is extracted from the variable pool based on the second variable name of the UI test case.
[0019] Optionally, after the step of using the second variable name and corresponding second variable value of the UI test case as test data, the method further includes:
[0020] The user interface is functionally verified based on the test data.
[0021] Optionally, before the step of performing functional verification of the user interface based on the test data, the method further includes:
[0022] Determine whether the value of the test data exceeds a preset range;
[0023] If the value of the test data does not exceed the preset range, then the following step is performed: verify the functionality of the user interface based on the test data.
[0024] Optionally, after the step of obtaining the identifier of the interface test case that maps to the identifier of the UI test case according to a preset mapping relationship when receiving the execution instruction for executing the UI test case, the method further includes:
[0025] If the number of identifiers of the interface test cases that are mapped to the identifier of the UI test case is greater than or equal to 1, then the following steps are executed: send the identifier of the interface test case to the server so that the server can execute the interface test case, and return the first variable value corresponding to the first variable name of the interface test case.
[0026] Furthermore, to achieve the above objectives, the present invention also provides a UI test data generation device, the UI test data generation device comprising:
[0027] The identifier acquisition module is used to acquire the identifier of the interface test case that is mapped to the identifier of the UI test case according to a preset mapping relationship when an execution instruction for executing the UI test case is received.
[0028] The identifier sending module is used to send the identifier of the interface test case to the server so that the server can execute the interface test case, and to return the first variable value corresponding to the first variable name of the interface test case;
[0029] The data acquisition module is used to obtain the second variable value corresponding to the second variable name of the UI test case based on the first variable name and the first variable value of the interface test case, and use the second variable name and the corresponding second variable value of the UI test case as test data.
[0030] Furthermore, to achieve the above objectives, the present invention also provides a UI test data generation device, the UI test data generation device including a memory, a processor, and a UI test data generation program stored in the memory and executable on the processor, wherein when the UI test data generation program is executed by the processor, it implements the steps of the UI test data generation method as described above.
[0031] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a UI test data generation program, which, when executed by a processor, implements the steps of the UI test data generation method as described above.
[0032] This invention automates the entire UI test case execution process by automatically executing the corresponding interface test case based on a preset mapping relationship when receiving an execution instruction for a UI test case. The identifier of the interface test case is obtained according to a preset mapping relationship, and the identifier is sent to a server for execution. The server then returns a first variable value corresponding to the first variable name of the interface test case. Finally, a second variable value corresponding to the second variable name of the UI test case is obtained based on the first variable name and value of the interface test case, and the second variable name and corresponding second variable value of the UI test case are used as test data. This achieves full automation of UI test case execution, thereby improving the efficiency, accuracy, and maintainability of UI testing. Attached Figure Description
[0033] Figure 1 This is a schematic diagram of the hardware operating environment of the device involved in the embodiment of the UI test data generation device of the present invention;
[0034] Figure 2 This is a flowchart illustrating the first embodiment of the UI test data generation method of the present invention;
[0035] Figure 3 This is a schematic diagram of the functional modules of the UI test data generation device of the present invention.
[0036] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0037] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0038] It's important to note that the existing UI testing workflow requires manual selection of the corresponding interface test cases for the UI test cases. The entire test case management system lacks configuration mapping and relies solely on the tester's business experience, resulting in poor maintainability. If a new tester needs to prepare data anew, they may be unsure which interface test cases to execute. Furthermore, the data returned after the interface test cases are executed requires manual input of the necessary variable values into the UI test cases, failing to achieve full automation. This leads to errors during the writing of numerous test cases and inefficient test case execution.
[0039] To address the aforementioned shortcomings, this invention provides a UI test data generation device, with reference to... Figure 1 , Figure 1 This is a schematic diagram of the hardware operating environment of the device involved in the embodiment of the UI test data generation device of the present invention.
[0040] like Figure 1 As shown, the UI test data generation device may include: a processor 1001, such as a CPU; a communication bus 1002; a user interface 1003; a network interface 1004; and a memory 1005. The communication bus 1002 is used to establish communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or stable non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0041] Those skilled in the art will understand that Figure 1 The hardware structure of the UI test data generation device shown in the figure does not constitute a limitation on the UI test data generation device. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0042] like Figure 1 As shown, the memory 1005, which serves as a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a UI test data generation program. The operating system is a program that manages and controls the UI test data generation device and software resources, supporting the operation of the network communication module, the user interface module, the UI test data generation program, and other programs or software. The network communication module manages and controls the network interface 1004; the user interface module manages and controls the user interface 1003.
[0043] exist Figure 1 In the hardware structure of the UI test data generation device shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with it; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with it; the processor 1001 can call the UI test data generation program stored in the memory 1005 and perform the following operations:
[0044] Upon receiving an execution instruction to execute a UI test case, the identifier of the interface test case that maps to the identifier of the UI test case is obtained according to a preset mapping relationship;
[0045] The identifier of the interface test case is sent to the server so that the server can execute the interface test case and return the value of the first variable corresponding to the first variable name of the interface test case;
[0046] Based on the first variable name and first variable value of the interface test case, obtain the second variable value corresponding to the second variable name of the UI test case, and use the second variable name and corresponding second variable value of the UI test case as test data.
[0047] Furthermore, before the step of obtaining the identifier of the interface test case that maps to the identifier of the UI test case according to a preset mapping relationship when receiving the execution instruction for executing the UI test case, the processor 1001 is also used to call the UI test data generation program stored in the memory 1005 and perform the following operations:
[0048] Upon receiving a mapping relationship setting instruction, obtain the identifiers of the UI test cases and the interface test cases carried in the mapping relationship setting instruction;
[0049] The identifiers of the UI test cases and the identifiers of the interface test cases are associated and saved as a preset mapping relationship.
[0050] Further, after the step of associating and saving the identifiers of the UI test cases and the identifiers of the interface test cases as a preset mapping relationship, the processor 1001 is also used to call the UI test data generation program stored in the memory 1005 and perform the following operations:
[0051] Upon receiving a variable name query instruction, the first variable name of the interface test case is obtained and displayed on the current page for testers to view;
[0052] Upon receiving a variable name setting instruction, the variable name carried by the variable name setting instruction is set as the second variable name of the UI test case, wherein the first variable name includes the second variable name.
[0053] Further, the step of obtaining the second variable value corresponding to the second variable name of the UI test case based on the first variable name and the first variable value of the interface test case includes:
[0054] The first variable name and the first variable value of the interface test case are associated and stored in the variable pool;
[0055] The second variable value corresponding to the second variable name is extracted from the variable pool based on the second variable name of the UI test case.
[0056] Furthermore, after the step of using the second variable name and corresponding second variable value of the UI test case as test data, the processor 1001 is also used to call the UI test data generation program stored in the memory 1005 and perform the following operations:
[0057] The user interface is functionally verified based on the test data.
[0058] Furthermore, the feature parameters also include decision thresholds. Before the step of functionally verifying the user interface based on the test data, the processor 1001 is also used to call the UI test data generation program stored in the memory 1005 and perform the following operations:
[0059] Determine whether the value of the test data exceeds a preset range;
[0060] If the value of the test data does not exceed the preset range, then the user interface is functionally verified based on the test data.
[0061] Furthermore, after the step of obtaining the identifier of the interface test case that maps to the identifier of the UI test case according to a preset mapping relationship when receiving the execution instruction for executing the UI test case, the processor 1001 is also used to call the UI test data generation program stored in the memory 1005 and perform the following operations:
[0062] If the number of identifiers of the interface test cases that are mapped to the identifier of the UI test case is greater than or equal to 1, then the identifier of the interface test case is sent to the server for the server to execute the interface test case, and the first variable value corresponding to the first variable name of the interface test case is fed back.
[0063] The specific implementation of the UI test data generation device of the present invention is basically the same as the embodiments of the UI test data generation method described below, and will not be repeated here.
[0064] This invention also provides a method for generating UI test data.
[0065] This invention provides an embodiment of a UI test data generation method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0066] In the various embodiments of the UI test data generation method, for ease of description, the execution entity is omitted from the description of each embodiment. (Refer to...) Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the UI test data generation method of the present invention. The UI test data generation method includes:
[0067] Step S10: Upon receiving the execution instruction for executing the UI test case, obtain the identifier of the interface test case that maps to the identifier of the UI test case according to the preset mapping relationship;
[0068] In the existing UI testing workflow, manual selection of interface test cases corresponding to UI test cases is required. The entire test case management is not based on configuration mapping, relying solely on the tester's business experience. This results in poor test case maintainability. If a new tester needs to prepare data again, they may not immediately know which interface test cases to execute. Furthermore, the data returned after the interface test cases are executed requires manual input of the necessary variable values into the UI test cases. This lack of end-to-end automation leads to errors during the writing of numerous test cases and low test case execution efficiency.
[0069] To address the technical problem of the inability to uniformly configure and manage UI test cases and interface test cases in existing technologies, this embodiment includes a step of setting the mapping relationship between UI test cases and interface test cases before step S10. Specifically, upon receiving a mapping relationship setting instruction, the identifiers of the UI test cases and interface test cases carried in the instruction are obtained; the identifiers of the UI test cases and interface test cases are associated and saved as a preset mapping relationship. By setting the mapping relationship between UI test cases and interface test cases, each UI test case has a corresponding interface test case. The number of interface test cases corresponding to a given UI test case can be one or more.
[0070] Upon receiving an execution instruction for a UI test case, the identifier of the UI test case carried in the instruction is obtained. Then, based on a preset mapping relationship, the identifier of the interface test case mapped to the UI test case identifier can be obtained. The generation of the execution instruction for the UI test case can be achieved by the tester selecting a UI test case to execute after setting the preset mapping relationship, thereby generating the execution instruction; or by the tester setting a batch execution time for UI test cases, and the server automatically generating the execution instruction when the preset execution time is reached. Either of these two methods for generating the execution instruction can be implemented, or they can be combined; this embodiment does not impose any restrictions.
[0071] Step S20: Send the identifier of the interface test case to the server so that the server can execute the interface test case and return the first variable value corresponding to the first variable name of the interface test case;
[0072] When an application is developed and enters the testing phase, one or more sets of interface test cases are designed based on the functions implemented by the application and the performance to be achieved. During the execution of the interface test cases, external interfaces will be called. In order to enable the interface test cases to run independently in a complete test environment, a server is set up to execute the interface test cases. This server can simulate the feedback data from the external interface.
[0073] In this embodiment, after obtaining the identifier of the interface test case that maps to the identifier of the UI test case, the test machine sends an interface test case execution request carrying the identifier to the server. Upon receiving the interface test case execution request, the server executes the interface test case. After the interface test case is executed, it outputs the variable value corresponding to each variable in the interface test case, i.e., the first variable value corresponding to the first variable name of the interface test case, and returns the first variable value corresponding to the first variable name of the interface test case to the test machine. The variable names of the interface test cases are set by the tester based on the output of the interface test case when writing it.
[0074] Step S30: Obtain the second variable value corresponding to the second variable name of the UI test case based on the first variable name and the first variable value of the interface test case, and use the second variable name and the corresponding second variable value of the UI test case as test data.
[0075] In this embodiment, after receiving the first variable value corresponding to the first variable name of the interface test case returned by the server, the test machine extracts the second variable value corresponding to the second variable name of the UI test case from the first variable name and its corresponding first variable value, and uses the second variable name and the corresponding second variable value of the UI test case as test data.
[0076] This embodiment achieves fully automated execution of UI test cases by automatically executing the corresponding interface test cases based on a preset mapping relationship when receiving an execution instruction for a UI test case. The identifier of the interface test case is obtained according to a preset mapping relationship, and the identifier is sent to the server for execution. The server then returns a first variable value corresponding to the first variable name of the interface test case. Finally, a second variable value corresponding to the second variable name of the UI test case is obtained based on the first variable name and first variable value of the interface test case. The second variable name and corresponding second variable value of the UI test case are used as test data. This fully automates the UI test case execution process, improving the efficiency, accuracy, and maintainability of UI testing.
[0077] Furthermore, a second embodiment of the UI test data generation method of the present invention is proposed, which further includes the following steps before step S10:
[0078] Step S11: Upon receiving the mapping relationship setting instruction, obtain the identifier of the UI test case and the identifier of the interface test case carried by the mapping relationship setting instruction;
[0079] In this embodiment, before step S10, a step of setting the mapping relationship between UI test cases and interface test cases is included. Testers configure corresponding interface test cases for the UI test cases based on factors such as the functional scenarios involved in the UI test cases, so that each UI test case has a corresponding interface test case. The number of interface test cases corresponding to a given UI test case can be one or more.
[0080] Step S12: Associate and save the identifiers of the UI test cases and the identifiers of the interface test cases as a preset mapping relationship.
[0081] Specifically, the tester sends a mapping relationship setting instruction to the test machine. This instruction carries the identifier of the UI test case to be configured and the identifier of the corresponding interface test case configured by the tester based on factors such as the functional scenarios involved in the UI test case. After obtaining the identifiers of the UI test case and the interface test case from the mapping relationship setting instruction, the test machine associates and saves the identifiers of the UI test case and the interface test case as a preset mapping relationship.
[0082] Furthermore, following step S12 above, the following is also included:
[0083] Step S13: Upon receiving a variable name query instruction, obtain the first variable name of the interface test case and display the first variable name on the current page for testers to view;
[0084] In this embodiment, since the interface test case may output multiple variables after execution, the mapped UI test case may not need to obtain all the output variables of the interface test case. Instead, it can selectively obtain the required variables from all the output variables of the interface test case according to the function of the UI test case. Therefore, after setting the mapping relationship between the UI test case and the interface test case, it is also necessary to set the variable names of the UI test case.
[0085] Step S14: Upon receiving a variable name setting instruction, the variable name carried by the variable name setting instruction is set as the second variable name of the UI test case, wherein the first variable name includes the second variable name.
[0086] Specifically, the tester sends a variable name query command to the testing machine to set variable names for the UI test cases. Upon receiving the variable name query command, the testing machine retrieves all variable names of the interface test cases, i.e., the first variable names, and displays them on the current page for the tester to view. After viewing the first variable names, the tester can select the required variable names from the first variable names according to the function of the UI test case, and send a variable name setting command carrying the required variable names to the testing machine. The testing machine sets the variable names carried by the variable name setting command as the second variable names of the UI test cases. The first variable names include the second variable names; that is, the second variable names are obtained from the first variable names. The variable names of the interface test cases are set by the tester based on the output of the interface test cases when writing them.
[0087] Further, the step S30 above, which involves obtaining the second variable value corresponding to the second variable name of the UI test case based on the first variable name and the first variable value of the interface test case, includes:
[0088] Step S31: Associate and store the first variable name and first variable value of the interface test case in the variable pool;
[0089] In this embodiment, when the application is developed and enters the testing phase, one or more sets of interface test cases are designed according to the functions implemented by the application and the performance to be achieved. During the execution of the interface test cases, external interfaces will be called. In order to enable the interface test cases to run independently in a complete test environment, a server is set up to execute the interface test cases. This server can simulate the feedback data from the external interface.
[0090] After the server completes the execution of the interface test case, it returns the value of the first variable corresponding to the first variable name of the interface test case to the test machine. After receiving the first variable value, the test machine associates the first variable name and the first variable value and stores them in the variable pool for use in UI test cases.
[0091] Step S32: Extract the second variable value corresponding to the second variable name from the variable pool according to the second variable name of the UI test case.
[0092] Based on the second variable name of the set UI test case, search for the same first variable name in the variable pool, and extract the value of the first variable name that is the same as the second variable name as the value of the second variable name. That is, the first variable value of the first variable name that is the same as the second variable name is used as the second variable value of the second variable name.
[0093] This embodiment lays the foundation for automating the entire process of UI test case execution by pre-configuring the preset mapping relationship between UI test cases and interface test cases, as well as pre-setting the variable names of UI test cases.
[0094] Furthermore, a third embodiment of the UI test data generation method of the present invention is proposed, which further includes the following after step S30:
[0095] Step S40: Verify the functionality of the user interface based on the test data.
[0096] In this embodiment, after the test machine obtains the test data of the UI test cases, it performs functional verification of the user interface based on the test data. For example, if the test data is the username and password of a social application, after obtaining the test data, the user enters the username and password on the login page of the social application, and it is determined whether the page displayed after login is the same as the expected page, that is, whether the page elements (such as controls) exist; if the page elements exist, it is determined whether the page elements are usable, so as to verify whether the user interface functions normally.
[0097] Furthermore, the test data from the current UI test case can also be used as input for other UI test cases.
[0098] Furthermore, prior to step S40 above, the following is also included:
[0099] Determine whether the value of the test data exceeds a preset range;
[0100] If the value of the test data does not exceed the preset range, then the following step is performed: verify the functionality of the user interface based on the test data.
[0101] When test data contains numerical information, to prevent erroneous data from causing processing errors, it is necessary to perform anomaly detection on the numerical information in the test data. This allows for the early detection of errors in the UI test case code, the interface test case code itself, or errors in the server simulation interface, thus avoiding incorrect test results. The preset range for test data can be a specific value or a numerical range. In both cases, the test machine must perform anomaly detection on the test data according to the preset range. Specifically, if the test data value does not exceed the preset range, it means the test data has passed the anomaly detection, and subsequent functional verification steps can be executed; if the test data value exceeds the preset range, it indicates that the test data is abnormal, and an alarm message can be displayed on the current page of the test machine.
[0102] Furthermore, following step S10 above, the following is also included:
[0103] If the number of identifiers of the interface test cases that are mapped to the identifier of the UI test case is greater than or equal to 1, then the following steps are executed: send the identifier of the interface test case to the server so that the server can execute the interface test case, and return the first variable value corresponding to the first variable name of the interface test case.
[0104] In this embodiment, upon receiving an execution instruction to execute a UI test case, the identifiers of interface test cases mapped to the identifiers of the UI test case are obtained according to a preset mapping relationship. If the number of interface test case identifiers mapped to the identifiers of the UI test case is greater than or equal to 1, the identifiers of the interface test cases are sent to the server for the server to execute the interface test cases, and the server returns the first variable value corresponding to the first variable name of the interface test case. If the number of interface test case identifiers mapped to the identifiers of the UI test case is 0, it means that the UI test case does not involve the call of an external interface and there is no need to execute the interface test case; therefore, no further steps are required.
[0105] This embodiment improves the efficiency, accuracy, and maintainability of UI testing.
[0106] The present invention also provides a UI test data generation device.
[0107] Reference Figure 3 , Figure 3 This is a functional module diagram of the first embodiment of the UI test data generation device of the present invention. The UI test data generation device is applied to the Ranger terminal, and the UI test data generation device includes:
[0108] The identifier acquisition module 10 is used to acquire the identifier of the interface test case that is mapped to the identifier of the UI test case according to a preset mapping relationship when it receives the execution instruction to execute the UI test case;
[0109] The identifier sending module 20 is used to send the identifier of the interface test case to the server so that the server can execute the interface test case, and to return the first variable value corresponding to the first variable name of the interface test case;
[0110] The data acquisition module 30 is used to acquire the second variable value corresponding to the second variable name of the UI test case based on the first variable name and the first variable value of the interface test case, and use the second variable name and the corresponding second variable value of the UI test case as test data.
[0111] The specific implementation of the UI test data generation device of the present invention is basically the same as the embodiments of the UI test data generation method described above, and will not be repeated here.
[0112] Furthermore, embodiments of the present invention also propose a readable storage medium (i.e., a computer-readable storage medium).
[0113] A UI test data generation program is stored on a readable storage medium. When the UI test data generation program is executed by the processor, it implements the steps of the UI test data generation method as described above.
[0114] The specific implementation of the readable storage medium of the present invention is basically the same as the embodiments of the UI test data generation method described above, and will not be repeated here.
[0115] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many modifications under the guidance of the present invention without departing from the spirit and scope of the claims. All equivalent structural or procedural transformations made using the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are within the protection scope of the present invention.
Claims
1. A user interface (UI) test data generation method, characterized by, The UI test data generation method comprises the following steps: Upon receiving an execution instruction for executing a UI test case, an identifier of an interface test case mapped with the identifier of the UI test case is obtained according to a preset mapping relationship; The identifier of the interface test case is sent to a server for the server to execute the interface test case and feed back a first variable value corresponding to a first variable name of the interface test case; Upon receiving a variable name query instruction, a first variable name of the interface test case is obtained and displayed on a current page for a tester to view; Upon receiving a variable name setting instruction, a variable name carried by the variable name setting instruction is set as a second variable name of the UI test case, and the first variable name comprises the second variable name; According to the first variable name and the first variable value of the interface test case, a second variable value corresponding to the second variable name of the UI test case is obtained, and the second variable name and the corresponding second variable value of the UI test case are taken as test data, comprising: storing the first variable name and the first variable value of the interface test case in a variable pool in association; and extracting a second variable value corresponding to the second variable name from the variable pool according to the second variable name of the UI test case.
2. The UI test data generation method of claim 1, wherein, Before the step of obtaining the identifier of the interface test case mapped with the identifier of the UI test case according to the preset mapping relationship upon receiving the execution instruction for executing the UI test case, the method further comprises: Upon receiving a mapping relationship setting instruction, an identifier of a UI test case and an identifier of an interface test case carried by the mapping relationship setting instruction are obtained; The identifier of the UI test case and the identifier of the interface test case are saved in association as a preset mapping relationship.
3. The UI test data generation method of claim 1, wherein, After the step of taking the second variable name and the corresponding second variable value of the UI test case as test data, the method further comprises: Performing function verification on a user interface according to the test data.
4. The UI test data generation method of claim 3, wherein, Before the step of performing function verification on the user interface according to the test data, the method further comprises: Determining whether a value of the test data is out of a preset range; If the value of the test data is not out of the preset range, performing the step of performing function verification on the user interface according to the test data.
5. The UI test data generation method according to any one of claims 1 to 4, wherein, After the step of obtaining the identifier of the interface test case mapped with the identifier of the UI test case according to the preset mapping relationship upon receiving the execution instruction for executing the UI test case, the method further comprises: If the number of the identifiers of the interface test cases mapped with the identifier of the UI test case is greater than or equal to 1, performing the step of sending the identifier of the interface test case to the server for the server to execute the interface test case and feed back the first variable value corresponding to the first variable name of the interface test case.
6. A UI test data generation device characterized by comprising: The UI test data generation device includes a memory, a processor, and a UI test data generation program stored on the memory and executable on the processor, the UI test data generation program, when executed by the processor, implementing the steps of the UI test data generation method according to any one of claims 1-5.
7. A readable storage medium, characterized by, The readable storage medium has a UI test data generation program stored thereon, the UI test data generation program, when executed by a processor, implementing the steps of the UI test data generation method according to any one of claims 1-5.
Citation Information
Patent Citations
A method and a terminal device for generating an automated test case
CN108984388A