CN115982024A - Test script generation method, test script generation device, storage medium, and program product - Google Patents
Test script generation method, test script generation device, storage medium, and program product Download PDFInfo
- Publication number
- CN115982024A CN115982024A CN202211676690.3A CN202211676690A CN115982024A CN 115982024 A CN115982024 A CN 115982024A CN 202211676690 A CN202211676690 A CN 202211676690A CN 115982024 A CN115982024 A CN 115982024A
- Authority
- CN
- China
- Prior art keywords
- page operation
- execution sequence
- page
- edited
- test script
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the application provides a test script generation method, test script generation equipment, a storage medium and a program product, wherein the method comprises the steps of recording and obtaining an initial test case in the process of carrying out page test on a service to be tested, the initial test case comprises at least one page operation and at least one execution sequence of the page operation, responding to the touch operation of a user on the at least one page operation in an editing interface, editing the initial test case, obtaining the edited page operation and a corresponding execution sequence, generating a test script according to the edited page operation and the corresponding execution sequence, executing the edited page operation according to the execution sequence corresponding to the edited page operation through executing the test script, and realizing the automatic test on the service to be tested. The method provided by the embodiment improves the simplicity and the efficiency of the generation of the test script, and further improves the efficiency of the function test.
Description
Technical Field
The embodiment of the application relates to the technical field of software testing, in particular to a test script generation method, test script generation equipment, a storage medium and a program product.
Background
The software test is an essential link in the software development process, and aims to discover latent defects in software, reduce software development and maintenance cost and promote software quality improvement. With the development of science and technology, the software iteration speed is high, and the requirement on the software testing efficiency is higher and higher.
In the related art, a test script can be manually written, and automatic testing is realized by executing the test script.
However, in the process of implementing the present application, the inventors found that at least the following problems exist in the prior art: the compiling of the test script requires that a tester has a programming power base, and the threshold is higher. How to simply and quickly complete the generation of the test script becomes a problem to be solved urgently at present.
Disclosure of Invention
The embodiment of the application provides a test script generation method, test script generation equipment, a storage medium and a program product, so that the simplicity and the efficiency of test script generation are improved.
In a first aspect, an embodiment of the present application provides a test script generating method, including:
recording to obtain an initial test case in the process of testing the page of the service to be tested; the initial test case comprises at least one page operation and an execution sequence of the at least one page operation;
responding to touch operation of a user on at least one page operation in an editing interface, editing the initial test case, and obtaining edited page operations and a corresponding execution sequence;
and generating a test script according to the edited page operation and the corresponding execution sequence, and executing the edited page operation according to the execution sequence corresponding to the edited page operation by executing the test script to realize the automatic test of the service to be tested.
In one possible design, the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence includes:
respectively displaying at least one page operation on a plurality of time nodes on a time axis according to the execution sequence;
and responding to the position adjustment operation of the user on the time axis of at least one page operation, and adjusting the execution sequence of the at least one page operation to obtain the edited page operation and the corresponding execution sequence.
In one possible design, the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence includes:
and responding to the deletion operation of the redundant page operation in the editing interface by the user, deleting the page operation, and obtaining the edited page operation and the corresponding execution sequence.
In a possible design, the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence includes:
if the first page operation selected in at least one page operation is data input operation, pushing a parameterization setting interface to a user;
and responding to the touch operation of the user on the parameterization setting interface, setting the input data corresponding to the first page operation as parameters, and obtaining the edited page operation and the corresponding execution sequence.
In a possible design, the setting input data corresponding to the first page operation as a parameter to obtain an edited page operation and a corresponding execution sequence includes:
setting input data corresponding to the first page operation as parameters, associating the parameters with a first storage space, and obtaining edited page operations and a corresponding execution sequence; the first storage space is used for storing candidate parameter values of the parameters.
In a possible design, the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence includes:
and responding to the touch operation of a user on an adding control in the editing interface, and setting a judgment condition for a second page operation selected in at least one page operation, so that in the subsequent automatic test process, according to whether the execution result of the second page operation meets the judgment condition, the test result of the detection point corresponding to the second page operation is determined.
In one possible design, the generating a test script according to the edited page operation and the corresponding execution sequence includes:
acquiring a code segment corresponding to the edited page operation from a code library;
and splicing the code segments according to the execution sequence corresponding to the edited page operation to obtain the test script.
In a second aspect, an embodiment of the present application provides a test script generating device, including:
the recording module is used for recording and obtaining an initial test case in the process of carrying out page test on the service to be tested; the initial test case comprises at least one page operation and an execution sequence of the at least one page operation;
the editing module is used for responding to touch operation of a user on at least one page operation in an editing interface, editing the initial test case and obtaining the edited page operation and a corresponding execution sequence;
and the generating module is used for generating a test script according to the edited page operation and the corresponding execution sequence, so that the edited page operation is executed according to the execution sequence corresponding to the edited page operation by executing the test script, and the automatic test of the service to be tested is realized.
In a third aspect, an embodiment of the present application provides a test script generating device, including: at least one processor and a memory;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored by the memory to cause the at least one processor to perform the method as set forth in the first aspect above and in various possible designs of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the method according to the first aspect and various possible designs of the first aspect are implemented.
In a fifth aspect, embodiments of the present application provide a computer program product, comprising a computer program, which when executed by a processor, performs the method as described in the first aspect and various possible designs of the first aspect.
The method includes recording an initial test case in a process of performing a page test on a service to be tested, where the initial test case includes at least one page operation and an execution sequence of the at least one page operation, editing the initial test case in response to a touch operation of a user on the at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence, and generating a test script according to the edited page operation and the corresponding execution sequence, so that the edited page operation is executed according to the execution sequence corresponding to the edited page operation by executing the test script, thereby implementing an automatic test on the service to be tested. According to the test script generation method provided by the embodiment, the page test process is recorded, the page operation and the corresponding execution sequence are captured, the initial test case is obtained, the initial test case is edited, the edited page operation and the corresponding execution sequence are obtained, and the test script is generated based on the edited page operation and the corresponding execution sequence, so that the automatic test of the relevant page of the service to be tested can be realized subsequently by executing the test script, the difficulty of test script generation is reduced, a tester does not need to master programming skills, the simplicity and the efficiency of test script generation are improved, and the efficiency of functional test is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings without inventive labor.
Fig. 1 is a schematic view of an application scenario of a test script generation method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a test script generation method according to an embodiment of the present application;
fig. 3 is a first schematic diagram of an editing interface provided in an embodiment of the present application;
fig. 4 is a schematic diagram of an editing interface provided in the embodiment of the present application;
fig. 5 is a schematic diagram of an editing interface provided in the embodiment of the present application;
fig. 6 is a schematic diagram of an editing interface provided in the embodiment of the present application;
fig. 7 is a schematic structural diagram of a test script generating device according to an embodiment of the present application;
fig. 8 is a schematic hardware structure diagram of a test script generating device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The software test is an essential link in the software development process, and aims to find latent defects in software, reduce software development and maintenance cost and promote software quality improvement. With the development of science and technology, the software iteration speed is high, and the requirement on the software testing efficiency is higher and higher.
In the related art, a test script can be manually compiled, and an automatic test is realized by executing the test script. However, the writing of the test script requires that the tester has a programming power base, and the threshold is high. How to simply and quickly complete the generation of the test script becomes a problem to be solved urgently at present.
In order to solve the technical problems, the inventor of the present application finds that a screen recording can be started when a tester executes a test case, and in the screen recording process, an event and an event occurrence sequence can be recorded by capturing page operations (such as mouse click and keyboard entry) of a user through recording software (such as a browser plug-in) to obtain an initial test case, and then the initial test case can be edited (such as deleting redundant events, editing parameter domains, setting check points and the like) based on a graphical interface to obtain edited page operations and a corresponding execution sequence, so that a test script can be conveniently generated based on the edited page operations and the corresponding execution sequence to deploy the test script, and automatic testing can be realized by executing the test script. In the process, a tester is not required to have programming power, the access threshold is low, the operation is convenient, and the simplicity and the efficiency of test script generation are improved. Based on this, the embodiment of the present application provides a test script generation method.
Fig. 1 is a schematic view of an application scenario of a test script generation method according to an embodiment of the present application. As shown in fig. 1, the terminal device 101 includes a display screen, and the display screen can be used to display a related page of a service to be tested. The terminal device 101 may be installed with a client of a test script generation platform, the client of the platform may record and obtain an initial test case during a process of performing a page test on a service to be tested, the initial test case includes at least one page operation and an execution sequence of the at least one page operation, the initial test case is edited in response to a touch operation of a user on the at least one page operation in an editing interface, an edited page operation and a corresponding execution sequence are obtained, and a test script is generated according to the edited page operation and the corresponding execution sequence. In this embodiment, the terminal device 101 may be a computer, a tablet computer, a mobile phone, or other devices.
In a specific implementation process, a display screen of the terminal device 101 displays a page related to a service to be tested in response to a touch operation of a user on a display interface, and performs a page test on the service to be tested through a manual operation (taking a login function as an example, through a series of operations of manually inputting a user name and a password, and clicking a login button, and the like), and in the test process, records the test process through a client of a test script generation platform to obtain an initial test case, where the initial test case includes at least one page operation and an execution sequence of the at least one page operation, edits the initial test case in response to the touch operation of the user on the at least one page operation in an editing interface to obtain the edited page operation and a corresponding execution sequence, and generates a test script according to the edited page operation and the corresponding execution sequence. Therefore, the test script can be deployed on the execution host, so that the page test of the service to be tested is automatically completed by executing the test script. According to the test script generation method provided by the embodiment, the page test process is recorded, the page operation and the corresponding execution sequence are captured, the initial test case is obtained, the initial test case is edited, the edited page operation and the corresponding execution sequence are obtained, and the test script is generated based on the edited page operation and the corresponding execution sequence, so that the automatic test of the relevant page of the service to be tested can be realized subsequently by executing the test script, the difficulty in generating the test script is reduced, a tester does not need to master the programming skill, the simplicity and the efficiency of generating the test script are improved, and the efficiency of functional test is improved.
It should be noted that the scenario diagram shown in fig. 1 is only an example, and the test script generation method and the scenario described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not form a limitation on the technical solution provided in the embodiment of the present application, and as a person having ordinary skill in the art knows that along with the evolution of the system and the occurrence of a new service scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
The technical solution of the present application will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a flowchart illustrating a test script generation method according to an embodiment of the present application. As shown in fig. 2, the method includes:
201. recording to obtain an initial test case in the process of testing the page of the service to be tested; the initial test case comprises at least one page operation and an execution sequence of the at least one page operation.
The execution subject of the present embodiment may be the terminal device shown in fig. 1.
Specifically, the test user can manually click on the relevant page of the service to be tested to perform the page test, and the page test process can be recorded through the browser plug-in the test process. During the recording process, page operations (mouse click, keyboard entry and the like) of a user and page elements related to the page operations (characteristic values such as serial numbers, names, position coordinates and the like of the elements can be extracted by parsing html) can be captured through the plug-in, and the occurrence sequence of the page operations can be recorded (for example, the occurrence time of different page operations can be recorded). The recording can be controlled by controls such as start, pause and end in the recording process.
In this embodiment, the initial test case obtained by recording may directly generate a test script, and the script may be deployed on an execution machine, that is, the execution machine may execute the script to implement an automated test on a service to be tested. In some embodiments, in order to obtain a more flexible and effective test script, the initial test case may be edited and then a test script may be generated.
202. And responding to the touch operation of the user on at least one page operation in the editing interface, editing the initial test case, and obtaining the edited page operation and the corresponding execution sequence.
Specifically, each page operation in the initial test case and the corresponding occurrence time thereof can be displayed on the editing interface. Furthermore, a touch operation of a user may be received at the editing interface, and based on the touch operation, the execution order of each page operation may be adjusted for the initial test case, the redundant page operations may be deleted, the input data of the data input page operation (for example, a page operation for inputting information such as a user name and a password) may be parameterized, and a judgment condition may be added to determine whether the page operation requiring the addition of the detection point passes the test.
In some embodiments, the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence may include: respectively displaying at least one page operation on a plurality of time nodes on a time axis according to the execution sequence; and responding to the position adjustment operation of the user on the time axis of at least one page operation, and adjusting the execution sequence of the at least one page operation to obtain the edited page operation and the corresponding execution sequence.
Illustratively, as shown in fig. 3, the page operations (event 1-event 3) are displayed at corresponding points in time on the timeline in the order of execution. The occurrence time of the page operation may be adjusted in response to a touch operation (e.g., a drag operation) of the user on the time axis, or directly by clicking a selected page operation and then changing the occurrence time of the page operation, for example, event 1 may be dragged between event 2 and event 3, so that the execution sequence of events 1-3 is changed to event 2, event 1 and event 3. For example, in the case of the user login function, the event 1 may be a user name input operation, the event 2 may be a password input operation, and the event 3 may be a login button click operation.
In some embodiments, the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence may include: and responding to the deletion operation of the redundant page operation in the editing interface by the user, deleting the page operation, and obtaining the edited page operation and the corresponding execution sequence.
Specifically, in the process of recording the initial test case, there may be some invalid page operations performed by the user, for example, there may be a click operation on a blank of the page. Then redundant page operations may be deleted in order to reduce the script and increase execution efficiency. For example, as shown in fig. 4, a user may select an event 2 by clicking, and display the detailed content (the operation type is a click operation, the operation position is a page blank, and the like) of the event 2 in a target area (the display may be a text display, or an image display, which may be specifically set according to actual needs, which is not limited in this embodiment).
In some embodiments, the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence may include: if the first page operation selected in at least one page operation is data input operation, pushing a parameterization setting interface to a user; and responding to the touch operation of the user on the parameterization setting interface, setting the input data corresponding to the first page operation as parameters, and obtaining the edited page operation and the corresponding execution sequence.
In some embodiments, the setting the input data corresponding to the first page operation as a parameter to obtain the edited page operation and the corresponding execution sequence may include: setting input data corresponding to the first page operation as parameters, associating the parameters with a first storage space, and obtaining edited page operations and a corresponding execution sequence; the first storage space is used for storing candidate parameter values of the parameters.
Specifically, for page operations of input data such as user name input, in order to improve the application range of the test script, the input data may be parameterized instead of being fixed in the code. As shown in fig. 5, taking event 1 as an input user name as an example, the input data of event 1 may be parameterized as a name, and then the parameter may be associated with a target file, where multiple user names may be recorded in the target file, so as to call a parameter value as a parameter name when the test script is executed.
In some embodiments, the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence may include: and responding to the touch operation of a user on an adding control in the editing interface, and setting a judgment condition for a second page operation selected in at least one page operation, so that in the subsequent automatic test process, according to whether the execution result of the second page operation meets the judgment condition, the test result of the detection point corresponding to the second page operation is determined.
Specifically, the purpose of the page test is to detect the page function, taking the login function as an example, after a correct user name and a correct password are input, if the login is successful, it is indicated that the login function has no problem, if a prompt page with a login error occurs, the login function may have defects, and in the script execution process, the results of the function test need to be detected and summarized, that is, a detection point needs to be added to collect the test results. Taking the login function as an example, a detection point may be added to a page operation triggered by the login button, and specifically, a login success page or a login failure page appearing after the login button is clicked may be used as a determination condition to collect a test result of the login function. As shown in fig. 6, in event 3, in the page operation triggered by the login button, the judgment condition of the execution result of event 3 is added, if the execution result is a login success page, it indicates that the login function test passes, and if the execution result is a login failure page, it indicates that the login function test fails, and the function has a defect, and the defect can be sent to the developer, so that the developer corrects the relevant code of the service to be tested.
203. And generating a test script according to the edited page operation and the corresponding execution sequence, so that the edited page operation is executed according to the execution sequence corresponding to the edited page operation by executing the test script, and the automatic test of the service to be tested is realized.
Specifically, after editing some or all page operations in the initial test case, the edited page operations and the execution sequence corresponding to the edited page operations are obtained. Furthermore, the code segments corresponding to the edited page operations can be called from the code library, and the code segments corresponding to the edited page operations can be spliced according to the execution sequence corresponding to the edited page operations, so as to obtain the test script. Therefore, the test script can be deployed on the execution machine, and the execution machine executes the test script to automatically test the service to be tested.
In some embodiments, the generating a test script according to the edited page operation and the corresponding execution sequence may include: acquiring a code segment corresponding to the edited page operation from a code library; and splicing the code segments according to the execution sequence corresponding to the edited page operation to obtain the test script.
According to the test script generation method provided by the embodiment, the page test process is recorded, the page operation and the corresponding execution sequence are captured, the initial test case is obtained, the initial test case is edited, the edited page operation and the corresponding execution sequence are obtained, and the test script is generated based on the edited page operation and the corresponding execution sequence, so that the automatic test of the relevant page of the service to be tested can be realized subsequently by executing the test script, the difficulty of test script generation is reduced, a tester does not need to master programming skills, the simplicity and the efficiency of test script generation are improved, and the efficiency of functional test is improved.
Fig. 7 is a schematic structural diagram of a test script generation device according to an embodiment of the present application. As shown in fig. 7, the test script generating apparatus 70 includes: a recording module 701, an editing module 702, and a generating module 703.
The recording module 701 is used for recording and obtaining an initial test case in the process of performing page testing on the service to be tested; the initial test case comprises at least one page operation and an execution sequence of the at least one page operation.
The editing module 702 is configured to edit the initial test case in response to a touch operation of a user on at least one page operation in an editing interface, and obtain an edited page operation and a corresponding execution sequence.
The generating module 703 is configured to generate a test script according to the edited page operation and the corresponding execution sequence, so as to execute the edited page operation according to the execution sequence corresponding to the edited page operation by executing the test script, thereby implementing an automatic test on the service to be tested.
The test script generating equipment provided by the embodiment of the application captures the page operation and the corresponding execution sequence by recording the page test process to obtain the initial test case, further edits the initial test case to obtain the edited page operation and the corresponding execution sequence, and generates the test script based on the edited page operation and the corresponding execution sequence, so that the automatic test of the relevant pages of the service to be tested can be realized subsequently by executing the test script, the difficulty of test script generation is reduced, a tester is not required to master programming skills, the simplicity and the efficiency of test script generation are improved, and the efficiency of function test is improved.
The test script generating device provided in the embodiment of the present application may be configured to execute the method embodiment described above, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 8 is a schematic diagram of a hardware structure of a test script generating device according to an embodiment of the present disclosure, where the device may be a computer, a messaging device, a tablet device, a medical device, and other devices having a display screen.
The processing component 801 generally controls overall operation of the device 80, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 801 may include one or more processors 809 for executing instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 801 may include one or more modules that facilitate interaction between the processing component 801 and other components. For example, the processing component 801 may include a multimedia module to facilitate interaction between the multimedia component 804 and the processing component 801.
The memory 802 is configured to store various types of data to support operation at the device 80. Examples of such data include instructions for any application or method operating on device 80, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 802 may be implemented by any type or combination of volatile and non-volatile storage devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A power supply component 803 provides power to the various components of the device 80. The power components 803 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 80.
The multimedia component 804 includes a screen providing an output interface between the device 80 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 804 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 80 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 805 is configured to output and/or input audio signals. For example, the audio component 805 includes a Microphone (MIC) configured to receive external audio signals when the device 80 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 802 or transmitted via the communication component 808. In some embodiments, the audio component 805 also includes a speaker for outputting audio signals.
The I/O interface 806 provides an interface between the processing component 801 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
In an exemplary embodiment, the device 80 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 802 comprising instructions, executable by the processor 809 of the device 80 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. A readable storage medium may be any available medium that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Embodiments of the present application further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the test script generation method implemented by the above test script generation device is implemented.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.
Claims (11)
1. A test script generation method, comprising:
recording to obtain an initial test case in the process of testing the page of the service to be tested; the initial test case comprises at least one page operation and an execution sequence of the at least one page operation;
responding to touch operation of a user on at least one page operation in an editing interface, editing the initial test case, and obtaining edited page operations and a corresponding execution sequence;
and generating a test script according to the edited page operation and the corresponding execution sequence, and executing the edited page operation according to the execution sequence corresponding to the edited page operation by executing the test script to realize the automatic test of the service to be tested.
2. The method according to claim 1, wherein the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence comprises:
respectively displaying at least one page operation on a plurality of time nodes on a time axis according to the execution sequence;
and responding to the position adjustment operation of the user on the time axis of at least one page operation, and adjusting the execution sequence of the at least one page operation to obtain the edited page operation and the corresponding execution sequence.
3. The method according to claim 1, wherein the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence comprises:
and responding to the deletion operation of the redundant page operation in the editing interface by the user, deleting the page operation, and obtaining the edited page operation and the corresponding execution sequence.
4. The method according to claim 1, wherein the editing the initial test case in response to a touch operation of a user on at least one page operation in an editing interface to obtain an edited page operation and a corresponding execution sequence comprises:
if the first page operation selected in at least one page operation is data input operation, pushing a parameterization setting interface to a user;
and responding to the touch operation of the user on the parameterization setting interface, setting the input data corresponding to the first page operation as parameters, and obtaining the edited page operation and the corresponding execution sequence.
5. The method according to claim 4, wherein the setting of the input data corresponding to the first page operation as a parameter to obtain the edited page operation and the corresponding execution sequence comprises:
setting input data corresponding to the first page operation as parameters, associating the parameters with a first storage space, and obtaining edited page operations and a corresponding execution sequence; the first storage space is used for storing candidate parameter values of the parameters.
6. The method according to any one of claims 1 to 5, wherein the editing the initial test case in response to a touch operation of a user on at least one of the page operations in an editing interface to obtain an edited page operation and a corresponding execution sequence comprises:
and responding to the touch operation of a user on an adding control in the editing interface, and setting a judgment condition for a second page operation selected in at least one page operation, so that in the subsequent automatic test process, according to whether the execution result of the second page operation meets the judgment condition, the test result of the detection point corresponding to the second page operation is determined.
7. The method according to any one of claims 1-5, wherein generating a test script according to the edited page operations and the corresponding execution order comprises:
acquiring a code segment corresponding to the edited page operation from a code library;
and splicing the code segments according to the execution sequence corresponding to the edited page operation to obtain the test script.
8. A test script generating apparatus, comprising:
the recording module is used for recording and obtaining an initial test case in the process of carrying out page test on the service to be tested; the initial test case comprises at least one page operation and an execution sequence of the at least one page operation;
the editing module is used for responding to touch operation of a user on at least one page operation in an editing interface, editing the initial test case and obtaining the edited page operation and a corresponding execution sequence;
and the generating module is used for generating a test script according to the edited page operation and the corresponding execution sequence, so that the edited page operation is executed according to the execution sequence corresponding to the edited page operation by executing the test script, and the automatic test of the service to be tested is realized.
9. A test script generating apparatus, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the test script generation method of any of claims 1 to 7.
10. A computer-readable storage medium having computer-executable instructions stored therein, which when executed by a processor, implement the test script generation method of any one of claims 1 to 7.
11. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the test script generation method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211676690.3A CN115982024A (en) | 2022-12-26 | 2022-12-26 | Test script generation method, test script generation device, storage medium, and program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211676690.3A CN115982024A (en) | 2022-12-26 | 2022-12-26 | Test script generation method, test script generation device, storage medium, and program product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115982024A true CN115982024A (en) | 2023-04-18 |
Family
ID=85962196
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211676690.3A Pending CN115982024A (en) | 2022-12-26 | 2022-12-26 | Test script generation method, test script generation device, storage medium, and program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115982024A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117312713A (en) * | 2023-10-10 | 2023-12-29 | 中国电力科学研究院有限公司 | Method and system for processing information creation environment based on browser automatic flow |
CN117539773A (en) * | 2023-11-22 | 2024-02-09 | 东风本田发动机有限公司 | Vehicle-mounted data acquisition method and device |
-
2022
- 2022-12-26 CN CN202211676690.3A patent/CN115982024A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117312713A (en) * | 2023-10-10 | 2023-12-29 | 中国电力科学研究院有限公司 | Method and system for processing information creation environment based on browser automatic flow |
CN117539773A (en) * | 2023-11-22 | 2024-02-09 | 东风本田发动机有限公司 | Vehicle-mounted data acquisition method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110134600B (en) | Test script recording method, device and storage medium | |
CN115982024A (en) | Test script generation method, test script generation device, storage medium, and program product | |
CN111273899B (en) | Code processing method, device, electronic equipment and storage medium | |
CN112241361A (en) | Test case generation method and device and problem scene automatic reproduction method and device | |
CN116069612A (en) | Abnormality positioning method and device and electronic equipment | |
CN112559309B (en) | Page performance acquisition algorithm adjusting method and device | |
CN113010157A (en) | Code generation method and device | |
CN111209195B (en) | Method and device for generating test case | |
CN112486770A (en) | Client dotting reporting method and device, electronic equipment and storage medium | |
CN112256563A (en) | Android application stability testing method and device, electronic equipment and storage medium | |
CN115408277B (en) | Interface testing method and device | |
CN115543831A (en) | Test script generation method, device, equipment and storage medium | |
CN112383661B (en) | Mobile terminal automatic test method and device, electronic equipment and storage medium | |
CN111290882B (en) | Data file backup method, data file backup device and electronic equipment | |
CN115098390A (en) | Automatic testing method and device, storage medium and electronic equipment | |
CN114661606A (en) | Program debugging method and device, electronic equipment and storage medium | |
CN112631695A (en) | Data verification method and device, electronic equipment and storage medium | |
CN113469876B (en) | Image style migration model training method, image processing method, device and equipment | |
CN113806227B (en) | Information processing method, device, electronic equipment and storage medium | |
CN113535183B (en) | Code processing method, device, electronic equipment and storage medium | |
CN112199250B (en) | Picture monitoring method and device, electronic equipment and storage medium | |
CN112346968B (en) | Automatic detection method and device for definition of multimedia file | |
CN114116075A (en) | Page parameter acquisition method and device, electronic equipment and storage medium | |
CN114661487A (en) | Data processing method and device, electronic equipment and storage medium | |
CN112416697A (en) | Information processing device, terminal and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |