A method and device for enhancing test scripts
By configuring multiple configuration portals, users can accurately initiate test script enhancement operations, solving the problem that existing test scripts are difficult to adapt to high-quality testing requirements, and improving the accuracy and efficiency of script enhancement.
Patent Information
- Application Number
- CN202410613030.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2044-05-17
AI Technical Summary
Existing test scripts are difficult to highly adapt to high-quality testing requirements in practical applications, resulting in manual script enhancement, and there are defects in processing accuracy and efficiency.
By configuring multiple configuration portals, users can easily, flexibly and accurately initiate test script enhancement operations, supporting various script enhancement directions such as global space, loading csv files, and sequential points.
It enables users to perform test script enhancement conveniently, flexibly and accurately, improves the accuracy and efficiency of script enhancement, and reduces the need for manual intervention.
Smart Images

Figure CN118394653B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing, and particularly to a method and device for enhancing test scripts. Background Art
[0002] In the development work of application services, the testing link is an important one. Only through testing can it be known whether the current application service meets the expected requirements. If not, obviously it needs to be returned for improvement, and finally a relatively perfect application service that passes the test can be obtained.
[0003] Currently, test scripts are widely used. Through test scripts, the pre-configured automated test logic is automatically executed to perform automated testing on the current system to meet the testing requirements. However, in this case, whether the test scripts configured in a manual configuration method or an automated configuration method often still have problems that they cannot highly adapt to the current high-quality test script usage requirements. At this time, it is often necessary for staff to perform further script enhancement operations. Because if the autonomous enhancement operation performed by the device can meet the requirements, then the autonomous enhancement operation itself can be incorporated into the automated configuration link of the test script and there will be no problem of not being able to highly adapt to the requirements. Thus, due to the characteristics of relying on manual operations, the script enhancement operation obviously has defects in processing accuracy and processing efficiency. Summary of the Invention
[0004] This application provides a method and device for enhancing test scripts. By configuring a novel test script enhancement operation configuration scheme, users can conveniently, flexibly, and accurately initiate corresponding test script enhancement operations.
[0005] In a first aspect, this application provides a method for enhancing test scripts. The method includes:
[0006] Obtain an initial test script, where the initial test script is a recorded execution script for initiating automated testing on a system to be tested;
[0007] Receive corresponding user operations through at least one configuration entry corresponding to the initial test script, where the configuration entry is used to input script enhancement content corresponding to the script enhancement direction in a preset user operation manner, and different configuration entries correspond to different script enhancement directions;
[0008] Perform a script enhancement operation on the initial test script according to the target script enhancement content of the user operation, and obtain a target test script.
[0009] In combination with the first aspect of the present application, in the first possible implementation manner of the first aspect of the present application, the script enhancement direction specifically involves the global space, loading a csv file, rendezvous points, think time, checkpoints, scheduled tasks, delayed execution of a task once, node numbers, start transaction, end time, current user, sending an http get request, and sending an http post request.
[0010] In combination with the first aspect of the present application, in the second possible implementation manner of the first aspect of the present application, before receiving the corresponding user operation through at least one configuration entry corresponding to the initial test script, the method further includes:
[0011] By displaying a preset selection button in the visual interface to achieve the purpose of displaying at least one configuration entry corresponding to the initial test script;
[0012] Receiving the corresponding user operation through at least one configuration entry corresponding to the initial test script includes:
[0013] Receiving the corresponding user selection operation through the selection button.
[0014] In combination with the first aspect of the present application, in the third possible implementation manner of the first aspect of the present application, before receiving the corresponding user operation through at least one configuration entry corresponding to the initial test script, the method further includes:
[0015] By displaying a preset input window in the visual interface to achieve the purpose of displaying at least one configuration entry corresponding to the initial test script;
[0016] Receiving the corresponding user operation through at least one configuration entry corresponding to the initial test script includes:
[0017] Receiving the corresponding user writing operation through the input window.
[0018] In combination with the first aspect of the present application, in the fourth possible implementation manner of the first aspect of the present application, the target script enhancement content of the user operation is specifically a target test scenario, and the test script content corresponding to the corresponding test scenario is referred to in the form of an intermediate variable;
[0019] Performing a script enhancement operation on the initial test script according to the target script enhancement content of the user operation includes:
[0020] Extracting the real script enhancement content corresponding to the target test scenario of the user operation;
[0021] Performing a script enhancement operation on the initial test script according to the real script enhancement content.
[0022] In a second aspect, the present application provides a test script enhancement device, and the device includes:
[0023] An acquisition unit, configured to acquire an initial test script, where the initial test script is a recorded execution script for initiating an automated test on a system under test;
[0024] A receiving unit, configured to receive corresponding user operations through at least one configuration entry corresponding to the initial test script, where the configuration entry is used to input script enhancement content corresponding to a script enhancement direction in a preset user operation manner, and different configuration entries correspond to different script enhancement directions;
[0025] An enhancement unit, configured to perform a script enhancement operation on the initial test script according to the target script enhancement content of the user operation, and obtain a target test script.
[0026] Combined with the second aspect of the present application, in the first possible implementation manner of the second aspect of the present application, the script enhancement direction specifically relates to global space, loading a csv file, rendezvous point, think time, checkpoint, scheduled task execution, delayed execution of a task once, node number, start transaction, end time, current user, sending an http get request, and sending an http post request.
[0027] Combined with the second aspect of the present application, in the second possible implementation manner of the second aspect of the present application, the apparatus further includes a display unit, configured to:
[0028] By displaying preset selection buttons in a visualization interface, to achieve the purpose of displaying at least one configuration entry corresponding to the initial test script;
[0029] The receiving unit is specifically configured to:
[0030] Receive corresponding user selection operations through the selection buttons.
[0031] Combined with the second aspect of the present application, in the third possible implementation manner of the second aspect of the present application, the apparatus further includes a display unit, configured to:
[0032] By displaying a preset input window in a visualization interface, to achieve the purpose of displaying at least one configuration entry corresponding to the initial test script;
[0033] The receiving unit is specifically configured to:
[0034] Receive corresponding user writing operations through the input window.
[0035] Combined with the second aspect of the present application, in the fourth possible implementation manner of the second aspect of the present application, the target script enhancement content of the user operation is specifically a target test scenario, and the test script content corresponding to the corresponding test scenario is represented in the form of an intermediate variable;
[0036] The enhancement unit is specifically configured to:
[0037] Extract the real script enhancement content corresponding to the target test scenario of the user operation;
[0038] Perform a script enhancement operation on the initial test script according to the real script enhancement content.
[0039] In a third aspect, the present application provides a processing device, including a processor and a memory. A computer program is stored in the memory. When the processor calls the computer program in the memory, it executes the method provided in the first aspect of the present application or any possible implementation manner of the first aspect of the present application.
[0040] In a fourth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the method provided in the first aspect of the present application or any possible implementation manner of the first aspect of the present application.
[0041] From the above content, it can be concluded that the present application has the following beneficial effects:
[0042] Regarding the target of test script enhancement, after obtaining the initial test script, the present application receives corresponding user operations through at least one configuration entry corresponding to the initial test script. This configuration entry is used to input the script enhancement content in the corresponding script enhancement direction in a preset user operation manner. Different configuration entries correspond to different script enhancement directions. Then, according to the target script enhancement content of the user operation, a script enhancement operation is performed on the initial test script, and a target test script is obtained. Under this processing mechanism, by configuring a novel test script enhancement operation configuration scheme, users can conveniently, flexibly, and accurately initiate corresponding test script enhancement operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0044] Figure 1 It is a schematic flowchart of a method for enhancing a test script of the present application;
[0045] Figure 2 It is a schematic diagram of a scenario of a script enhancement direction of the present application;
[0046] Figure 3 It is another schematic diagram of a scenario of a script enhancement direction of the present application;
[0047] Figure 4It is a schematic structural diagram of a test script enhancement device of the present application;
[0048] Figure 5 It is a schematic structural diagram of a processing device of the present application. Specific embodiments
[0049] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0050] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order other than that shown or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or modules does not have to be limited to those steps or modules clearly listed, but may include other steps or modules not clearly listed or inherent to these processes, methods, products or devices. The naming or numbering of steps that appear in the present application does not mean that the steps in the method flow must be executed in the time / logical order indicated by the naming or numbering. The named or numbered process steps can be changed in the order of execution according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.
[0051] The division of modules in the present application is a logical division. In actual implementation, there may be other division methods. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections between modules can be electrical or other similar forms, which are not limited in the present application. And the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed to multiple circuit modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present application.
[0052] Before introducing the test script enhancement method provided by the present application, the background content involved in the present application will be introduced first.
[0053] The test script enhancement method, device, and computer-readable storage medium provided by this application can be applied to a processing device. By configuring a novel test script enhancement operation configuration scheme, users can initiate corresponding test script enhancement operations conveniently, flexibly, and precisely.
[0054] The execution subject of the test script enhancement method mentioned in this application can be a test script enhancement device, or different types of processing devices such as a server, a physical host, or a user equipment (UE) that integrates this test script enhancement device. Among them, the test script enhancement device can be implemented in hardware or software. The UE can specifically be a terminal device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, or a personal digital assistant (PDA). The processing device can be set up in the form of a device cluster.
[0055] It can be understood that for the processing device that executes the test script enhancement method of this application or the application service that carries the test script enhancement method of this application, considering that the key point of the solution of this application is the secondary processing of the existing / ready-made test script, only the requirements for the corresponding data processing ability need to be met, and no specific limitation is made on the specific device form. A typical example is the physical host in the hands of staff during software development work. If it also involves recording test scripts or initiating specific test processing based on test scripts, the processing device needs to be more adaptively adjusted according to the actual situation to adapt to the specific application scenario. For example, the processing device can specifically be a test device that combines initiating tests, recording test scripts, and secondary processing of test scripts. Another example is that the processing device can specifically be a device cluster consisting of a first processing device for initiating tests and recording test scripts and a second processing device for secondary processing of test scripts.
[0056] Next, the test script enhancement method provided by this application will be introduced.
[0057] First, refer to Figure 1 , Figure 1 which shows a schematic flowchart of a process of the test script enhancement method of this application. The test script enhancement method provided by this application specifically may include the following steps S101 to S103:
[0058] Step S101, obtain an initial test script, where the initial test script is an execution script that has been recorded and is used to initiate an automated test for the system under test;
[0059] It can be understood that the test script involved in the present application is an execution script that initiates automated testing of the system under test under the corresponding test benchmark, by simulating different user operations that may be involved in the actual use of the system under test to observe the response of the system under test, so as to obtain the specific performance of the system under test.
[0060] Among them, the specific system types and test benchmarks involved can obviously be flexibly adjusted according to actual needs in specific operations. Therefore, this application does not make specific restrictions.
[0061] For the convenience of explanation, the test script obtained in step S101 here is recorded as the initial test script, wherein the acquisition process of the initial test script can, on the one hand, be completed by local retrieval. For example, the local processing device itself will perform the recording operation of the test script under the task arrangement, so that the previously recorded initial test script can be retrieved. For example, the initial test script has been received / retrieved from the outside of the device and stored, so that the initial test script previously recorded by other devices can be retrieved. On the other hand, the initial test script can be obtained by manual entry. On the other hand, the initial test script can be obtained by real-time reception / retrieval from other devices. The specific settings can be adaptive according to actual needs.
[0062] Step S102, receiving a corresponding user operation through at least one configuration entry corresponding to the initial test script, wherein the configuration entry is used to input script enhancement content corresponding to the script enhancement direction in a preset user operation mode, and different configuration entries correspond to different script enhancement directions;
[0063] It should be understood that, according to conventional thinking, when performing script enhancement operations for users and considering providing users with a solution for inputting test script enhancement content, it remains at the general level of providing a configuration entry for users to input test script enhancement content through user operations. To put it more simply, what is usually considered is to configure a single, one configuration entry for users to input test script enhancement content through user operations.
[0064] This is because the user (staff) who initiates the test script enhancement operation is, by default, highly familiar with the test script and has mature operating experience. Therefore, providing a configuration entry for inputting user operations to manually configure the test script enhancement content is sufficient to meet actual needs.
[0065] However, the inventor of the present application has come up with the idea that the test script enhancement operation can also be initiated by users who do not have mature operating experience, or even by users with no operating experience. In this way, in actual situations, the test script enhancement needs of different personnel involved in software development work can be met.
[0066] To this end, the present application configures a multi-configuration entry mechanism. Behind different configuration entries, there are corresponding script enhancement directions. It can be understood that this means that different script enhancement directions are pre-arranged and presented in the form of configuration entries. Thus, for the provided different script enhancement directions, they are presented to the user in a very intuitive and easy-to-understand manner, so that the user can conveniently match their own test script enhancement requirements, determine the corresponding script enhancement direction from the provided different script enhancement directions, and based on the determined script enhancement direction, input the corresponding script enhancement content. Here, for the sake of convenience of description, the script enhancement content input at this time is denoted as the target script enhancement content.
[0067] In this case, it can be obtained that the multi-configuration entry mechanism here helps to provide clear guidance for the script enhancement directions that the user can choose during the process of pre-configuring different script enhancement directions. The user can also configure the script enhancement content of the corresponding script enhancement direction for one or more configuration entries. In this way, the user can conveniently, flexibly and accurately initiate the corresponding test script enhancement operation.
[0068] In addition, the multi-configuration entry mechanism here can also perform highly adaptable classification / categorization (i.e., different script enhancement directions) in advance for subsequent efficient script enhancement processing. Thus, when the user inputs the script enhancement content of a specific script enhancement direction to promote the script enhancement operation, it also helps to improve the operation accuracy and operation efficiency of the background.
[0069] That is to say, the multi-configuration entry mechanism constructed by the present application can not only optimize the visualization and convenience in the early stage for the user, but also optimize the subsequent enhancement operation process, which is obviously impossible to achieve by simply providing a general solution for the user to input the test script enhancement content.
[0070] Step S103: Perform a script enhancement operation on the initial test script according to the target script enhancement content of the user operation, and obtain the target test script.
[0071] After obtaining the target script enhancement content that describes what script enhancement operations to perform, obviously, the corresponding script enhancement operation can be carried out on the initial test script obtained previously according to the target script enhancement content to achieve the planned script enhancement goal. In this way, the target test script can be obtained.
[0072] It can be understood that after obtaining the target script enhancement content, a verification process may be involved, such as user identity verification, permission verification, or content correctness verification, etc., in different aspects to determine whether to perform script enhancement operations based on the target script enhancement content as required. The specific verification content of this verification process can obviously be flexibly adjusted according to actual needs. Considering that it is not the focus of this application, specific descriptions will not be elaborated here.
[0073] After obtaining the target test script, in specific applications, the data processing work involved in the target test script can be further promoted according to corresponding processing requirements. For example, simply storing the target test script locally or remotely, or launching corresponding automated system test tasks based on the target test script, or pushing reminder messages to staff through corresponding push channels to remind that the script enhancement target of the initial test script has been completed. Further, it can also remind whether to promote automated operations such as storing or executing automated test tasks based on the target test script, achieving the effect of user confirmation.
[0074] From Figure 1 As can be seen from the illustrated embodiments, for the test script enhancement target, after obtaining the initial test script, this application receives corresponding user operations through at least one configuration entry corresponding to the initial test script. This configuration entry is used to input script enhancement content in a preset user operation manner for the corresponding script enhancement direction. Different configuration entries correspond to different script enhancement directions. Then, according to the target script enhancement content of the user operation, script enhancement operations can be performed on the initial test script to obtain the target test script. Under this processing mechanism, by configuring a novel test script enhancement operation configuration scheme, users can conveniently, flexibly, and accurately initiate corresponding test script enhancement operations.
[0075] Continue to elaborate in detail on each step of the above Figure 1 illustrated embodiments and their possible implementation manners in actual applications.
[0076] As an exemplary embodiment, the script enhancement directions involved in this application may specifically involve global space (webstorage), loading CSV files (load_csv), rendezvous points (waiteevent), thinking time (sleep), checkpoints (check), scheduled task execution (set_interval), one-time delayed task execution (set_timeout), node numbers (worker_index), starting transactions (start_trasactiton), end times (end_trasaction), current users (current_user), sending HTTP GET requests (get), and sending HTTP POST requests (post).
[0077] It can be understood that this provides a set of specific implementation support solutions for different script enhancement directions that can be configured in the specific operations of this application.
[0078] Among them, the script enhancement directions listed above can be further classified. For example, referring to Figure 2 and Figure 3 The schematic diagrams of the scenarios of the script enhancement directions of this application shown respectively are as follows:
[0079] Global space (webstorage), loading CSV files (load_csv), rendezvous points (waiteevent), thinking time (sleep), checkpoints (check), scheduled task execution (set_interval), and one-time delayed task execution (set_timeout) are script enhancement directions in the overall aspect.
[0080] Global space (webstorage), node numbers (worker_index), starting transactions (start_trasactiton), end times (end_trasaction), current users (current_user), sending HTTP GET requests (get), and sending HTTP POST requests (post) are script enhancement directions in the detailed aspect.
[0081] It can be noted that the element of global space (webstorage) involved in the test script can be related to both the overall aspect and the detailed aspect.
[0082] Meanwhile, it should also be understood that in specific operations, for the script enhancement directions listed above, other script enhancement directions may also be involved, or replaced by other script enhancement directions, which can be adaptively adjusted according to specific application requirements, so as to meet the complex and changeable test script enhancement requirements of users in actual situations.
[0083] For the configuration entry involved in step S101, it can be more intuitively presented to the user through a visual interface.
[0084] Correspondingly, as another exemplary embodiment, before step S102 receives the corresponding user operation through at least one configuration entry corresponding to the initial test script, the method of the present application may further include:
[0085] By displaying a preset selection button in the visual interface, the purpose of displaying at least one configuration entry corresponding to the initial test script is achieved;
[0086] In this case, step S102 receiving the corresponding user operation through at least one configuration entry corresponding to the initial test script may include:
[0087] Receiving the corresponding user selection operation through the selection button.
[0088] In this embodiment, it can be understood that by using the selection button for the user to select the pre-determined script enhancement directions and their script enhancement contents shown in the visual interface, it has high visualization, and the user does not need to do too much thinking and operation within the limited selection range, especially suitable for users who do not have operation experience in test script enhancement operations, and has the characteristics of high convenience and precise operation.
[0089] In addition, as another exemplary embodiment, before step S102 receives the corresponding user operation through at least one configuration entry corresponding to the initial test script, the method of the present application may further include:
[0090] By displaying a preset input window in the visual interface, the purpose of displaying at least one configuration entry corresponding to the initial test script is achieved;
[0091] In this case, the step of receiving the corresponding user operation through at least one configuration entry corresponding to the initial test script may include:
[0092] Receiving the corresponding user writing operation through the input window.
[0093] It can be understood that here, through the input window, the user can input the corresponding script enhancement direction and its script enhancement content in the window. The input window involved can be either the application interface of the corresponding application or the web page window based on the web service. Both are similar to the embodiment involving the selection button above. Further, the input window involved in this embodiment can also be the programming interface or the relevant background interface in the programming environment. In comparison, it is more suitable for users with certain experience in test script enhancement operations, and they can flexibly input content according to their own needs.
[0094] When the input window has a certain degree of flexibility for the user, not only can the touch method, keyboard input method be adopted, but also the voice input method and the like can be adopted to meet the more flexible input needs of the user in actual situations.
[0095] In addition, in specific operations, it can be understood that in addition to needing to display a visual interface for the user to input, it is also possible to directly input operation instructions to allow the user to input the corresponding content without involving a specially configured visual interface. This obviously makes it more convenient for users who are more familiar with or have operating experience in test script enhancement operations to complete.
[0096] Furthermore, this application can also be set so that it does not require the user to select specific script enhancement directions and their script enhancement content. This application abstracts different script enhancement directions and their different script enhancement content, and makes an induction of the applicable test scenarios. After such secondary processing, different test scenarios can be obtained, and for each test scenario, obviously, there are corresponding script enhancement directions and script enhancement content in terms of test script enhancement.
[0097] Correspondingly, as another exemplary embodiment, the target script enhancement content of the user operation involved in step S102 of this application can specifically be the target test scenario, and the test script content corresponding to the test scenario is represented in the form of an intermediate variable.
[0098] In this case, step S103 performs a script enhancement operation on the initial test script according to the target script enhancement content of the user operation, which may include:
[0099] Extracting the real script enhancement content corresponding to the target test scenario of the user operation;
[0100] Performing a script enhancement operation on the initial test script according to the real script enhancement content.
[0101] It should be understood that in the embodiments herein, the present application does not configure the test scenarios that the user can input / select according to the test scenarios applicable to the test script (the input methods are similar to the several methods mentioned above). The present application does not strip the prerequisite of the test script enhancement operation, that is, the present application is based on the test script enhancement operation to set different test scenarios corresponding to different script enhancement directions and different script enhancement contents, so as to achieve the characteristics of further improved convenience and accuracy.
[0102] In this way, after the user inputs the target test scenario (configured in the form of a scenario identifier) to represent the script enhancement direction and its script enhancement content that he actually wants to input, the corresponding script enhancement content (compared with the test scenario used for reference, it can be called the real script enhancement content) corresponding to the target test scenario can be obtained through the corresponding relationship pre-configured in the form of a mapping table, and the specific script enhancement operation can be promoted based on the obtained script enhancement content.
[0103] The above is an introduction to the test script enhancement method provided by the present application. To facilitate better implementation of the test script enhancement method provided by the present application, the present application also provides a test script enhancement device from the perspective of functional modules.
[0104] See Figure 4 , Figure 4 FIG. is a schematic structural diagram of a test script enhancement device of the present application. In the present application, the test script enhancement device 400 may specifically include the following structures:
[0105] An acquisition unit 401, configured to acquire an initial test script, where the initial test script is a recorded execution script for initiating an automated test on a system under test;
[0106] A receiving unit 402, configured to receive corresponding user operations through at least one configuration entry corresponding to the initial test script, where the configuration entry is used to input the script enhancement content of the corresponding script enhancement direction in a preset user operation manner, and different configuration entries correspond to different script enhancement directions;
[0107] An enhancement unit 403, configured to perform a script enhancement operation on the initial test script according to the target script enhancement content of the user operation, and obtain a target test script.
[0108] In an exemplary embodiment, the script enhancement direction specifically involves global space, loading a csv file, rendezvous point, think time, checkpoint, scheduled task execution, one-time delayed task execution, node number, start transaction, end time, current user, sending an http get request, and sending an http post request.
[0109] In yet another exemplary embodiment, the apparatus further includes a display unit 404, configured to:
[0110] By displaying preset selection buttons in the visualization interface, to achieve the purpose of displaying at least one configuration entry corresponding to the initial test script;
[0111] The receiving unit 402 is specifically configured to:
[0112] Receive the corresponding user selection operation through the selection button.
[0113] In yet another exemplary embodiment, the apparatus further includes a display unit 404, configured to:
[0114] By displaying a preset input window in the visualization interface, to achieve the purpose of displaying at least one configuration entry corresponding to the initial test script;
[0115] The receiving unit 402 is specifically configured to:
[0116] Receive the corresponding user writing operation through the input window.
[0117] In yet another exemplary embodiment, the target script enhancement content of the user operation is specifically a target test scenario, and the test script content corresponding to the corresponding test scenario is referred to in the form of an intermediate variable;
[0118] The enhancement unit 403 is specifically configured to:
[0119] Extract the real script enhancement content corresponding to the target test scenario of the user operation;
[0120] Perform a script enhancement operation on the initial test script according to the real script enhancement content.
[0121] The present application also provides a processing device from the perspective of the hardware structure. Refer to Figure 5 , Figure 5 FIG. shows a schematic structural diagram of the processing device of the present application. Specifically, the processing device of the present application may include a processor 501, a memory 502, and an input / output device 503. The processor 501 is configured to implement the steps of the test script enhancement method in the corresponding embodiment when executing the computer program stored in the memory 502; or, the processor 501 is configured to implement the functions of each unit in the corresponding embodiment when executing the computer program stored in the memory 502. The memory 502 is used to store the computer program required for the processor 501 to execute the test script enhancement method in the above Figure 1 corresponding embodiment; Figure 4 corresponding embodiment; Figure 1 corresponding embodiment.
[0122] Exemplarily, a computer program may be divided into one or more modules / units, and one or more modules / units are stored in the memory 502 and executed by the processor 501 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the computer device.
[0123] The processing device may include, but is not limited to, the processor 501, the memory 502, and the input / output device 503. Those skilled in the art can understand that the illustration is only an example of the processing device and does not constitute a limitation on the processing device. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the processing device may also include a network access device, a bus, etc. The processor 501, the memory 502, the input / output device 503, etc. are connected through a bus.
[0124] The processor 501 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc. The processor is the control center of the processing device and connects various parts of the entire device through various interfaces and lines.
[0125] The memory 502 may be used to store computer programs and / or modules. The processor 501 realizes various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 502, and by calling the data stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system, application programs required for at least one function, etc.; the data storage area may store data created according to the use of the processing device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0126] When the processor 501 is used to execute the computer program stored in the memory 502, the following functions can be specifically implemented:
[0127] Obtain an initial test script, where the initial test script is a recorded execution script for initiating an automated test on the system under test;
[0128] Receive corresponding user operations through at least one configuration entry corresponding to the initial test script, where the configuration entry is used to input script enhancement content in a preset user operation manner for the corresponding script enhancement direction, and different configuration entries correspond to different script enhancement directions;
[0129] Perform a script enhancement operation on the initial test script according to the target script enhancement content of the user operation, and obtain a target test script.
[0130] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described test script enhancement device, processing device, and their corresponding units can refer to, for example, Figure 1 the description of the test script enhancement method in the corresponding embodiment, and will not be specifically described here.
[0131] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware through instructions. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0132] Therefore, the present application provides a computer-readable storage medium, which stores multiple instructions that can be loaded by a processor to execute the steps of the test script enhancement method of the present application as Figure 1 described in the corresponding embodiment. The specific operations can refer to, for example, Figure 1 the description of the test script enhancement method in the corresponding embodiment, and will not be repeated here.
[0133] Among them, the computer-readable storage medium may include: Read Only Memory (ROM), Random Access Memory (RAM), a magnetic disk, an optical disc, etc.
[0134] Since the instructions stored in the computer-readable storage medium can execute the steps of the test script enhancement method of the present application as Figure 1 described in the corresponding embodiment, the beneficial effects that can be achieved by the test script enhancement method of the present application as Figure 1 described in the corresponding embodiment can be realized. For details, please refer to the previous description and will not be repeated here.
[0135] The above has introduced in detail the test script enhancement method, device, processing device, and computer-readable storage medium provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation on the present application.
Claims
1. A test script enhancement method, characterized in that: The method comprises: Obtaining an initial test script, wherein the initial test script is a recorded execution script for initiating an automated test on the system under test; Receiving a corresponding user operation through at least one configuration entry corresponding to the initial test script, wherein the configuration entry is used to input script enhancement content corresponding to the script enhancement direction in a preset user operation mode, and different configuration entries correspond to different script enhancement directions; According to the target script enhancement content operated by the user, the initial test script is subjected to script enhancement operation to obtain the target test script; The script enhancement direction specifically involves global space, loading csv files, rendezvous point, thinking time, checkpoint, scheduled task execution, delayed task execution, node number, start transaction, end time, current user, sending http get request and sending http post request; The target script enhancement content of the user operation is specifically a target test scenario, which refers to the test script content of the corresponding test scenario in the form of an intermediate variable. Different test scenarios are abstracted and summarized from the different script enhancement directions and different script enhancement contents; The step of performing script enhancement operation on the initial test script according to the target script enhancement content operated by the user includes: Extracting real script enhancement content corresponding to the target test scenario of the user operation; According to the real script enhancement content, the initial test script is subjected to script enhancement operation.
2. The method according to claim 1, characterized in that Before receiving a corresponding user operation through at least one configuration entry corresponding to the initial test script, the method further includes: By displaying a preset selection button in the visual interface, the purpose of displaying at least one configuration entry corresponding to the initial test script is achieved; The receiving a corresponding user operation through at least one configuration entry corresponding to the initial test script includes: The corresponding user selection operation is received through the selection button.
3. The method according to claim 1, characterized in that Before receiving a corresponding user operation through at least one configuration entry corresponding to the initial test script, the method further includes: By displaying a preset input window in a visual interface, the purpose of displaying at least one configuration entry corresponding to the initial test script is achieved; The receiving a corresponding user operation through at least one configuration entry corresponding to the initial test script includes: The corresponding user writing operation is received through the input window.
4. A test script enhancement device, characterized in that: The device comprises: An acquisition unit, used to acquire an initial test script, wherein the initial test script is a recorded execution script used to initiate an automated test to the system under test; A receiving unit, used to receive a corresponding user operation through at least one configuration entry corresponding to the initial test script, wherein the configuration entry is used to input script enhancement content corresponding to the script enhancement direction in a preset user operation mode, and different configuration entries correspond to different script enhancement directions; An enhancement unit, configured to enhance the content of the target script operated by the user, perform a script enhancement operation on the initial test script, and obtain a target test script; The script enhancement direction specifically involves global space, loading csv files, rendezvous point, thinking time, checkpoint, scheduled task execution, delayed task execution, node number, start transaction, end time, current user, sending http get request and sending http post request; The target script enhancement content of the user operation is specifically a target test scenario, which refers to the test script content of the corresponding test scenario in the form of an intermediate variable. Different test scenarios are abstracted and summarized from the different script enhancement directions and different script enhancement contents; The enhancement unit is specifically used for: Extracting real script enhancement content corresponding to the target test scenario of the user operation; According to the real script enhancement content, the initial test script is subjected to script enhancement operation.
5. The device according to claim 4, characterized in that The device also includes a display unit, which is used to: By displaying a preset selection button in the visual interface, the purpose of displaying at least one configuration entry corresponding to the initial test script is achieved; The receiving unit is specifically used for: The corresponding user selection operation is received through the selection button.
6. The device according to claim 4, characterized in that The device also includes a display unit, which is used to: By displaying a preset input window in a visual interface, the purpose of displaying at least one configuration entry corresponding to the initial test script is achieved; The receiving unit is specifically used for: The corresponding user writing operation is received through the input window.
Citation Information
Patent Citations
Recording script generation method and device, computer equipment and storage medium
CN117609060A
Test script generation method and device for browser
CN117707946A