CN112463639A - Test script editing method, device and equipment - Google Patents

Test script editing method, device and equipment Download PDF

Info

Publication number
CN112463639A
CN112463639A CN202011473111.6A CN202011473111A CN112463639A CN 112463639 A CN112463639 A CN 112463639A CN 202011473111 A CN202011473111 A CN 202011473111A CN 112463639 A CN112463639 A CN 112463639A
Authority
CN
China
Prior art keywords
script
editing
page
test
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
Application number
CN202011473111.6A
Other languages
Chinese (zh)
Inventor
卢奇材
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Testin Information Technology Co Ltd
Original Assignee
Beijing Testin Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Testin Information Technology Co Ltd filed Critical Beijing Testin Information Technology Co Ltd
Priority to CN202011473111.6A priority Critical patent/CN112463639A/en
Publication of CN112463639A publication Critical patent/CN112463639A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a method, a device and equipment for editing a test script. The method comprises the following steps: in response to an editing instruction aiming at a first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface, wherein the script editing interface comprises a second editing page corresponding to a second test script; acquiring script information corresponding to a first test script; and generating a first test script according to the script information, and displaying the first test script on the first editing page. Therefore, according to the technical scheme, the effect of opening a plurality of test scripts simultaneously and editing a plurality of test scripts on the same script editing interface is achieved by creating a plurality of editing pages on the script editing interface, so that the problem of low script editing efficiency caused by repeated operation is solved, and the editing efficiency of the automatic test scripts is improved.

Description

Test script editing method, device and equipment
Technical Field
The invention relates to the technical field of automatic testing, in particular to a method, a device and equipment for editing a test script.
Background
During software development, it is common to test the software for potential errors and bugs, or to confirm that the software meets the performance requirements set forth by the user prior to software development. Because manual testing consumes a lot of time and labor, and the testing efficiency is low, the software is usually tested in an automatic testing mode at present stage based on the consideration of testing time and testing cost.
At present, automatic scripts are all in a single script editing mode, that is, when a user uses the same device to perform an automatic test, after the device is bound and a script is edited, the currently edited script page is exited, another script page can be entered, and then the previous operations of binding the device and editing the script are repeated. Therefore, the user needs to frequently open the script, quit the script and bind the equipment, and the operation is complicated and the efficiency is low.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device and equipment for editing a test script, which are used for solving the problem of low editing efficiency of an automatic test script in the prior art.
In order to solve the above technical problem, the embodiment of the present application is implemented as follows:
in one aspect, an embodiment of the present invention provides a method for editing a test script, including:
in response to an editing instruction aiming at a first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface; the script editing interface comprises a second editing page corresponding to a second test script;
acquiring script information corresponding to the first test script;
and generating the first test script according to script information corresponding to the first test script, and displaying the first test script on the first edit page.
On the other hand, an embodiment of the present invention provides an editing apparatus for a test script, including:
the creating module is used for responding to an editing instruction aiming at a first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface; the script editing interface comprises a second editing page corresponding to a second test script;
the acquisition module is used for acquiring script information corresponding to the first test script;
and the generating module is used for generating the first test script according to the script information corresponding to the first test script and displaying the first test script on the first editing page.
In another aspect, an embodiment of the present invention provides a test script editing apparatus, including a processor and a memory electrically connected to the processor, where the memory stores a computer program, and the processor is configured to call and execute the computer program from the memory to implement:
in response to an editing instruction aiming at a first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface; the script editing interface comprises a second editing page corresponding to a second test script;
acquiring script information corresponding to the first test script;
and generating the first test script according to script information corresponding to the first test script, and displaying the first test script on the first edit page.
In another aspect, an embodiment of the present invention provides a storage medium for storing a computer program, where the computer program is executed by a processor to implement the following processes:
in response to an editing instruction aiming at a first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface; the script editing interface comprises a second editing page corresponding to a second test script;
acquiring script information corresponding to the first test script;
and generating the first test script according to script information corresponding to the first test script, and displaying the first test script on the first edit page.
By adopting the technical scheme of the embodiment of the invention, under the condition that the script editing interface comprises the second editing page corresponding to the second test script, the first editing page is created on the script editing interface aiming at the editing instruction of the first test script, and the first page identifier corresponding to the first editing page is displayed at the first position on the script editing interface; and then script information corresponding to the first test script is obtained, the first test script is generated according to the script information, and the first test script is displayed on the first editing page. Therefore, according to the technical scheme, a plurality of editing pages can be created on the same script editing interface, so that the effects of simultaneously opening a plurality of test scripts and editing a plurality of test scripts on the same script editing interface are achieved, the current script editing page does not need to be quitted when another test script is edited, the problem of low script editing efficiency caused by repeated operation is solved, and the editing efficiency of the automatic test scripts 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 needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic flow chart diagram of a method of editing a test script in accordance with one embodiment of the present invention;
FIG. 2 is a schematic interface diagram for determining script type in a test script editing method according to an embodiment of the present invention;
FIG. 3 is a schematic interface diagram of a script editing interface in a test script editing method according to an embodiment of the present invention;
FIG. 4 is a schematic interface diagram of a script editing interface in a test script editing method according to another embodiment of the present invention;
FIG. 5 is a schematic flow chart diagram of a method for editing a test script according to another embodiment of the present invention;
FIG. 6 is a schematic block diagram of an apparatus for editing a test script according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of an editing apparatus for a test script according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method, a device and equipment for editing a test script, which are used for solving the problem of low editing efficiency of an automatic test script in the prior art.
In order to make those skilled in the art better understand the technical solutions in the present application, 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 only a part of the embodiments of the present application, and not all of the 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.
Fig. 1 is a schematic flow chart of a test script editing method according to an embodiment of the present invention, as shown in fig. 1, the method includes:
s102, responding to an editing instruction aiming at the first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface. And the script editing interface comprises a second editing page corresponding to the second test script.
In one embodiment, the first location on the script editing interface may be a tab bar on the script editing interface, and the first paging identifier is a paging tab in the tab bar. For example, when receiving an operation of clicking a tag adding button "+" in a tab bar on the script editing interface by a user, a new page tag is created behind a currently existing page tag (e.g., a page tag corresponding to a second editing page), so as to create an editing page corresponding to the first test script.
And S104, acquiring script information corresponding to the first test script.
The script information comprises script identification information and script content. The script identification information may include one or more of a script name, a script tag, a script type, etc. corresponding to the test script. The script tag corresponding to the test script may be a call script, a test script, or the like.
S106, generating a first test script according to the script information corresponding to the first test script, and displaying the first test script on the first editing page.
In this step, after the first test script is generated according to the script information corresponding to the first test script, the first test script may be run on the first edit page. When the first test script is operated, whether the first test script is bound with the application to be tested corresponding to the first test script or not can be judged firstly, and if the first test script is not bound, prompt information can be output to prompt a user to bind the first test script and the application to be tested. Or, after the first edit page is created, the first test script to be generated and the application to be tested may be bound first, and then the first test script is generated. How to bind the application to be tested will be explained in detail in the following embodiments.
By adopting the technical scheme of the embodiment of the invention, under the condition that the script editing interface comprises the second editing page corresponding to the second test script, the first editing page is created on the script editing interface aiming at the editing instruction of the first test script, and the first page identifier corresponding to the first editing page is displayed at the first position on the script editing interface; and then script information corresponding to the first test script is obtained, the first test script is generated according to the script information, and the first test script is displayed on the first editing page. Therefore, according to the technical scheme, a plurality of editing pages can be created on the same script editing interface, so that the effects of simultaneously opening a plurality of test scripts and editing a plurality of test scripts on the same script editing interface are achieved, the current script editing page does not need to be quitted when another test script is edited, the problem of low script editing efficiency caused by repeated operation is solved, and the editing efficiency of the automatic test scripts is improved.
In an embodiment, before the first test script is generated according to the script information corresponding to the first test script, the script type corresponding to the first test script may be determined, and then the script information corresponding to the first test script may be obtained according to the script type. The script type comprises a first type of script to be newly built and/or a second type of script stored locally, and the script information comprises script identification information and script content.
FIG. 2 is a schematic interface diagram that illustrates determining a script type on a script editing interface in one embodiment. As shown in fig. 2, after a first editing page is created on the script editing interface, and a first page identifier corresponding to the first editing page is displayed at a first position on the script editing interface, a popup for determining a script type may be popped up, an option "create new script" corresponding to a first type of script to be newly created and an option "open existing script" corresponding to a second type of script stored locally are displayed on the popup, and a user may complete the determination of the script type by selecting any option on the popup.
After the script type is determined, when obtaining script information corresponding to the first test script according to the script type, obtaining may be performed in the following manner:
in the first mode, the script type corresponding to the first test script is the first type script to be newly built. An input entry for script identification information is first displayed on the first edit page, and the input entry is available for a user to input the script identification information. After the user inputs the script identification information through the input entry, the script identification information corresponding to the first test script can be obtained. In addition, a script editing area is also displayed on the first editing page, and a user can edit script contents in the script editing area. The script content corresponding to the first test script can be obtained by obtaining the script content edited by the user in the script editing area. In the first mode, when the user edits the script content in the script editing area on the first editing page, the script content can be edited in various modes.
For example, the script content is edited by recording the script in the script editing area, as shown in fig. 3, a "record" button is displayed on the script editing page, and if the user wants to edit the script content for testing the "log-out" operation, the "record" button on the script editing interface may be clicked to trigger the script editing tool to record the operation of the user. When the user executes log-out operation, if the user triggers my button, setting button, log-out button and other buttons in sequence, the log-out operation steps of the user are converted into corresponding script languages, and script contents corresponding to the first test script are generated. The scripting language may include multiple languages such as JavaScript.
As another example, the user may manually edit the script content in the script editing area. Or pasting part of script contents in the copied other test scripts to corresponding positions of the current script editing area.
And in the second mode, the script type corresponding to the first test script is a second type of script stored locally. By determining the local storage path corresponding to the first test script, script identification information and script content corresponding to the first test script can be obtained according to the local storage path corresponding to the first test script.
In the second mode, when the local storage path corresponding to the first test script is determined, the determination may be based on an input operation or a selection operation of the user on the local storage path. For example, when a user opens a certain file stored locally, the opened path of the file is the local storage path corresponding to the first test script.
The second type of script and the local storage path corresponding to the second type of script are stored in an associated manner, and based on the result, after the local storage path corresponding to the first test script is determined, the script information corresponding to the first test script can be determined according to the path and the script stored in the local associated manner.
In one embodiment, the first position not only displays the first page identifier corresponding to the first editing page, but also displays the second page identifier corresponding to the second editing page. Namely, a plurality of page identifiers are simultaneously displayed on the script editing interface. And displaying a first test script on the first editing page, and when receiving selection operation aiming at each page identifier on the first position, switching the current editing page on the script editing interface to a target editing page corresponding to the selection operation.
For example, if the current editing page is the first editing page corresponding to the first test script, when the user clicks the second page identifier, the current editing page is switched to the second editing page corresponding to the second test script, so that the user can switch between the multiple editing pages quickly.
In this embodiment, the first location may be a tab bar on the script editing interface, and the paging identifier may be a paging tab in the tab bar.
By selecting the paging label corresponding to each editing paging in the label bar, the editing paging of the test script corresponding to each paging label can be switched, and then different test scripts are displayed on the script editing interface. Therefore, the technical scheme of the embodiment can realize that a plurality of test scripts are opened on the same script editing interface, avoid inconvenience caused by frequent opening or closing of the test scripts, and is beneficial to improving the working efficiency of testers.
In one embodiment, script content may be edited across editing pages. Obtaining script information corresponding to the first test script through the following steps: first, when the current editing page is switched to the second editing page, a copy operation of the first script content of the second test script is received. Secondly, when the current editing page is switched to the first editing page, a pasting operation on the first script content is received. And finally, pasting the first script content to a corresponding position on the first editing page according to the copying operation and the pasting operation.
In this embodiment, when the current editing page is switched from the first editing page to the second editing page, the user may select the first script content of the second test script on the second editing page to copy, and then click the page identifier corresponding to the first editing page, so that the current editing page is switched to the first editing page corresponding to the first test script, and further paste the copied first script content to the corresponding position on the first editing page.
Therefore, the script content can be copied and pasted across the editing pages without closing other opened test scripts by switching the current editing pages of the script editing interface, and the script editing efficiency is greatly improved.
In one embodiment, multiple test scripts displayed on the same script editing interface may perform test tasks simultaneously. If the current editing page is the second editing page and the target editing page is the first editing page, after the current editing page on the script editing interface is switched to the target editing page, and under the condition that the second test script is in a running state, when a running instruction for the first test script is received, the first test script is run based on the running instruction. Wherein, the whole script content of the first test script can be executed based on the operation instruction, or if some part of the script content is specified in the operation instruction, only the part of the script content specified by the operation instruction can be executed.
In the present embodiment, fig. 4 is a schematic interface diagram of a script editing interface in a test script editing method according to an embodiment of the present invention. As shown in fig. 4, the script editing page displays an "all playback" button, and the user can execute the test script corresponding to the current editing page by clicking the "all playback" button. The target editing page is the editing page corresponding to the first test script, and the page identifier of the editing page is an expression. The current editing page is the editing page corresponding to the second test script, and the page identifier of the current editing page is "test 1". The user clicks the "all playback" button on the script editing interface, and a run instruction for the second test script is issued. And when an operation instruction sent by a user is received, the second test script can be operated based on the operation instruction.
When the script editing interface is switched from the current editing page to the target editing page, if an operation instruction for the first test script is received, the first test script is operated based on the operation instruction when the second test script is in an operation state, and at the moment, the effect of simultaneously operating a plurality of test scripts on the same script editing interface can be realized. In addition, before the current editing page is switched to the target editing page according to the test requirements of the user, the running of the second test script is suspended, namely, the running of only the first test script is executed.
Therefore, compared with the method that only one test script can be opened at one time, more than one test script can be simultaneously operated by switching the current editing pages, more test works can be completed in the same time, and the script content appointed by the execution part is selected according to the test requirement, so that the automatic test efficiency can be greatly improved.
In one embodiment, after a first test script is generated according to script information corresponding to the first test script, if an operation instruction for the first test script is received, whether the first test script binds to an application to be tested is judged. And if the application to be tested is bound, executing a first test script aiming at the application to be tested. And if the application to be tested is not bound, outputting prompt information, wherein the prompt information is used for prompting that the first test script is not bound with the application to be tested.
In this embodiment, after the first test script is generated according to the script information corresponding to the first test script, if an operation instruction for the first test script is received, the to-be-tested application corresponding to the first test script needs to be bound. When the first test script is not bound with the application to be tested, the following steps are required to be carried out for binding operation:
firstly, a user needs to bind a mobile device to which an application to be tested belongs, as shown in fig. 3, the user clicks a "device activation" button displayed on the left side on a script editing interface, so that the display interface of the mobile device can be mapped at any position on the script editing interface, as shown in the left position on the script editing interface shown in fig. 4, and the application to be tested is an application program in the mobile device.
And secondly, when an operation instruction of the first test script is received, outputting prompt information on a script editing interface to prompt a user to select an application to be tested which needs to be bound. The user may select the application to be tested by at least one of: and performing a selection operation on the application to be tested on a display screen mapping interface (in a left position shown in fig. 4) of the movable device, for example, selecting an icon of the application "a" shown in fig. 4. In another mode, the selection operation of the application to be tested is directly performed on the display screen of the movable device. After the script editing tool executes the binding operation, the first test script can be run, namely the bound application is tested by using the first test script.
It is assumed that a plurality of test scripts are simultaneously opened on the script editing interface, for example, a first test script corresponding to a first editing page and a second test script corresponding to a second editing page are included, and the first test script and the second test script are respectively bound with different applications to be tested. After the script editing interface is switched from the first editing page to the second editing page, when an operation instruction for the second test script is received, if the first test script is operating, the first test script can be stopped to operate based on the operation instruction, and the second test script starts to operate, that is, the second test script is executed to test the application to be tested bound with the first test script.
Fig. 5 is a schematic flow chart of a test script editing method according to another embodiment of the present invention, as shown in fig. 5, the method includes the following steps:
s501, under the condition that a second editing page corresponding to a second test script is included on the script editing interface, responding to an editing instruction aiming at a first test script, and creating a first editing page on the script editing interface.
S502, determining a script type corresponding to the first test script, wherein the script type comprises a first type script to be newly built and a second type script stored locally.
In this step, the options corresponding to each script type can be displayed on the script editing interface for the user to select. And determining the script type corresponding to the first test script according to the selection operation of the user on the option of the script type. The manner in which the user selects the script type may be performed as in the embodiment shown in fig. 2, and is not repeated here.
S503, acquiring script identification information corresponding to the first test script according to the script type corresponding to the first test script, and displaying the script identification information corresponding to the first test script as a first paging identification on a label bar on the script editing interface, wherein a second paging identification corresponding to the second test script is also displayed in the label bar.
If the script type is the first type script, when the script identification information is acquired, an input entry of the script identification information can be displayed on the first editing page, and the input entry can be used for a user to input the script identification information. After the script identification information is obtained, a first paging identification corresponding to the first editing paging can be displayed on a tab bar on a script editing interface. The first paging identifier may be script identification information.
If the script type is the second type script, when acquiring the script identification information, a local storage path corresponding to the first test script may be determined first, and then the script identification information and the script content corresponding to the first test script may be acquired according to the local storage path.
S504, when a selection operation for the second paging mark in the label bar is received, the script editing interface is switched from the first editing paging to the second editing paging.
S505, when a copy operation of the first script content in the second test script is received, copying the first script content; and when the pasting operation of the first script content on the first editing page is received, pasting the first script content to the corresponding position on the first editing page.
In this step, the first script content is a part or all of the script content in the second test script. The script content in the copied second test script is pasted to the first editing page and can be directly used as partial script content of the first test script, or editing operation (such as adding, deleting or changing operation) is carried out on the pasted first script content to generate new script content, and the script content obtained after editing is used as the script content of the second test script, so that cross-script copying and pasting functions are realized, and the script editing mode is simpler, more convenient and faster.
S506, generating a first test script according to the script identification information and the script content corresponding to the first test script, and displaying the first test script on the first edit page.
S507, the first test script and the target application to be tested are bound.
In this step, the user needs to bind the mobile device to which the target application to be tested belongs in advance, and then perform a selection operation on the target application to be tested on a display screen mapping interface (the left position shown in fig. 4) of the mobile device, for example, select an icon of application "a" shown in fig. 4. Or, directly carrying out the selection operation of the target application to be tested on the display screen of the movable equipment.
And S508, receiving an operation instruction for the first test script, and operating the first test script based on the operation instruction to obtain a test result corresponding to the target application.
By adopting the technical scheme of the embodiment, a plurality of test scripts can be opened on the same script editing interface, the editing pages of the test scripts corresponding to the paging labels can be switched to by selecting the paging labels corresponding to the editing pages in the label bar, different test scripts are displayed on the script editing interface, and inconvenience caused by frequent opening or closing of the test scripts is avoided. In addition, through switching the current editing page of the script editing interface, the script content can be copied and pasted across editing pages without closing other opened test scripts, and compared with the method that only one test script can be opened at one time, the method reduces repeated and complicated operations and provides convenience for testers. In addition, a plurality of test scripts can be simultaneously operated aiming at the same application to be tested, more test work can be carried out within limited time, and the efficiency of automatic test is effectively improved.
Based on the same idea, the embodiment of the present application further provides an editing apparatus for a test script.
Fig. 6 is a schematic block diagram of an apparatus for editing a test script according to an embodiment of the present invention. As shown in fig. 6, the test script editing apparatus may include:
a creating module 610, configured to create a first edit page on a script edit interface in response to an edit instruction for a first test script, and display a first page identifier corresponding to the first edit page at a first position on the script edit interface; the script editing interface comprises a second editing page corresponding to a second test script;
an obtaining module 620, configured to obtain script information corresponding to the first test script;
a generating module 630, configured to generate the first test script according to script information corresponding to the first test script, and display the first test script on the first edit page.
In one embodiment, the obtaining module 620 includes:
the determining unit is used for determining the script type corresponding to the first test script; the script type comprises a first type of script to be newly built and/or a second type of script stored locally;
and the obtaining unit is used for obtaining the script information corresponding to the first test script according to the script type.
In one embodiment, the script information includes script identification information and script content;
the obtaining unit is further configured to display an input entry of the script identification information on the first editing page if the script type is the first type of script; acquiring script identification information input through an input entry and script contents edited by a script editing area on a first editing page; and if the script type is the second type script, determining a local storage path corresponding to the first test script, and acquiring script identification information and script content corresponding to the first test script according to the local storage path.
In one embodiment, the first position further displays a second paging identifier corresponding to the second editing page;
the device further comprises:
the first receiving module is used for receiving selection operation aiming at each paging mark on a first position after a first test script is displayed on a first editing paging;
and the switching module is used for switching the current editing page on the script editing interface to a target editing page corresponding to the selection operation.
In one embodiment, the obtaining module 620 further comprises:
a first receiving unit, configured to receive a copy operation of first script content of a second test script when a current edit page is switched to a second edit page;
a second receiving unit, configured to receive a paste operation on the first script content when the current editing page is switched to the first editing page;
and the pasting unit is used for pasting the first script content to the corresponding position on the first editing page according to the copying operation and the pasting operation.
In one embodiment, the current edit page is a second edit page; the target editing page is a first editing page;
the device further comprises:
a second receiving module, configured to receive an operation instruction for the first test script when the second test script is in an operation state after the current editing page on the script editing interface is switched to the target editing page corresponding to the selection operation;
and the operation module is used for operating the first test script based on the operation instruction.
In one embodiment, the apparatus further comprises:
the judging module is used for generating a first test script according to script information corresponding to the first test script, and judging whether the first test script is bound with an application to be tested or not when an operation instruction for the first test script is received after the first test script is displayed on the first editing page;
the execution module is used for executing the first test script aiming at the application to be tested if the first test script is true;
the output module is used for outputting prompt information if the input module is not used for inputting the prompt information; the prompt message is used for prompting that the first test script is not bound with the application to be tested.
In one embodiment, the first location is a tab bar on the script editing interface; the paging flag is a paging tag in the tab bar.
By adopting the device provided by the embodiment of the invention, under the condition that the script editing interface comprises the second editing page corresponding to the second test script, the first editing page is created on the script editing interface aiming at the editing instruction of the first test script, and the first page identifier corresponding to the first editing page is displayed at the first position on the script editing interface; and then script information corresponding to the first test script is obtained, the first test script is generated according to the script information, and the first test script is displayed on the first editing page. Therefore, according to the technical scheme, a plurality of editing pages can be created on the same script editing interface, so that the effects of simultaneously opening a plurality of test scripts and editing a plurality of test scripts on the same script editing interface are achieved, the current script editing page does not need to be quitted when another test script is edited, the problem of low script editing efficiency caused by repeated operation is solved, and the editing efficiency of the automatic test scripts is improved.
Based on the same idea, an embodiment of the present invention further provides an editing apparatus for a test script, as shown in fig. 4. The editing equipment of the test script may have a large difference due to different configurations or performances, and may include one or more processors 701 and a memory 702, where one or more stored applications or data may be stored in the memory 702. Memory 702 may be, among other things, transient storage or persistent storage. The application program stored in memory 702 may include one or more modules (not shown), each of which may include a series of computer-executable instructions in an editing device for test scripts. Still further, the processor 701 may be configured to communicate with the memory 702 to execute a series of computer-executable instructions in the memory 702 on an editing device for a test script. The editing apparatus of the test script may also include one or more power supplies 703, one or more wired or wireless network interfaces 704, one or more input-output interfaces 705, and one or more keyboards 706.
In particular, in this embodiment, the editing apparatus for the test script comprises a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may comprise one or more modules, and each module may comprise a series of computer-executable instructions for the editing apparatus for the test script, and the one or more programs configured to be executed by the one or more processors comprise computer-executable instructions for:
in response to an editing instruction aiming at the first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface; the script editing interface comprises a second editing page corresponding to a second test script;
acquiring script information corresponding to a first test script;
and generating a first test script according to script information corresponding to the first test script, and displaying the first test script on the first editing page.
An embodiment of the present application further provides a storage medium storing one or more computer programs, where the one or more computer programs include instructions, which, when executed by an electronic device including a plurality of application programs, enable the electronic device to execute the above-mentioned method for editing a test script, and are specifically configured to perform:
in response to an editing instruction aiming at the first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface; the script editing interface comprises a second editing page corresponding to a second test script;
acquiring script information corresponding to a first test script;
and generating a first test script according to script information corresponding to the first test script, and displaying the first test script on the first editing page.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for editing a test script, comprising:
in response to an editing instruction aiming at a first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface; the script editing interface comprises a second editing page corresponding to a second test script;
acquiring script information corresponding to the first test script;
and generating the first test script according to script information corresponding to the first test script, and displaying the first test script on the first edit page.
2. The method according to claim 1, wherein the obtaining script information corresponding to the first test script comprises:
determining a script type corresponding to the first test script; the script type comprises a first type of script to be newly built and/or a second type of script stored locally;
and acquiring the script information corresponding to the first test script according to the script type.
3. The method of claim 2, wherein the script information comprises script identification information and script content;
the obtaining of the script information corresponding to the first test script according to the script type includes:
if the script type is the first type script, displaying an input entry of the script identification information on the first editing page; acquiring the script identification information input through the input entry and the script content edited in the script editing area on the first editing page;
if the script type is the second type script, determining a local storage path corresponding to the first test script, and acquiring the script identification information and the script content corresponding to the first test script according to the local storage path.
4. The method according to claim 3, wherein the first position further displays a second page identifier corresponding to the second editing page;
after the first test script is shown on the first edit page, the method further includes:
receiving a selection operation for each page identifier at the first location;
and switching the current editing page on the script editing interface to a target editing page corresponding to the selection operation.
5. The method according to claim 4, wherein the obtaining script information corresponding to the first test script comprises:
when the current editing page is switched to the second editing page, receiving a copy operation of first script content of the second test script;
receiving a pasting operation on the first script content when the current editing page is switched to the first editing page;
and pasting the first script content to a corresponding position on the first editing page according to the copying operation and the pasting operation.
6. The method of claim 4, wherein the current edit page is the second edit page; the target edit page is the first edit page;
after the current editing page on the script editing interface is switched to the target editing page corresponding to the selection operation, the method further includes:
under the condition that the second test script is in a running state, receiving a running instruction of the first test script;
and executing the first test script based on the operation instruction.
7. The method according to claim 1, wherein after the first test script is generated according to script information corresponding to the first test script and is displayed on the first edit page, the method further comprises:
when an operation instruction for the first test script is received, judging whether the first test script is bound with an application to be tested;
if yes, executing the first test script aiming at the application to be tested;
if not, outputting prompt information; the prompt information is used for prompting that the first test script is not bound with the application to be tested.
8. The method of claim 4, the first location being a tab bar on the scripting interface; the paging identification is a paging label in the label bar.
9. An apparatus for editing a test script, comprising:
the creating module is used for responding to an editing instruction aiming at a first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface; the script editing interface comprises a second editing page corresponding to a second test script;
the acquisition module is used for acquiring script information corresponding to the first test script;
and the generating module is used for generating the first test script according to the script information corresponding to the first test script and displaying the first test script on the first editing page.
10. An editing apparatus for testing scripts, comprising a processor and a memory electrically connected to the processor, the memory storing a computer program, the processor being configured to call and execute the computer program from the memory to implement:
in response to an editing instruction aiming at a first test script, creating a first editing page on a script editing interface, and displaying a first page identifier corresponding to the first editing page at a first position on the script editing interface; the script editing interface comprises a second editing page corresponding to a second test script;
acquiring script information corresponding to the first test script;
and generating the first test script according to script information corresponding to the first test script, and displaying the first test script on the first edit page.
CN202011473111.6A 2020-12-15 2020-12-15 Test script editing method, device and equipment Pending CN112463639A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011473111.6A CN112463639A (en) 2020-12-15 2020-12-15 Test script editing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011473111.6A CN112463639A (en) 2020-12-15 2020-12-15 Test script editing method, device and equipment

Publications (1)

Publication Number Publication Date
CN112463639A true CN112463639A (en) 2021-03-09

Family

ID=74803527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011473111.6A Pending CN112463639A (en) 2020-12-15 2020-12-15 Test script editing method, device and equipment

Country Status (1)

Country Link
CN (1) CN112463639A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113238742A (en) * 2021-06-17 2021-08-10 南方电网科学研究院有限责任公司 Method, device, terminal and medium for modifying and replaying direct-current control protection page program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108038134A (en) * 2017-11-20 2018-05-15 东软集团股份有限公司 The method, apparatus and storage medium and electronic equipment of page presentation
CN110716853A (en) * 2018-07-13 2020-01-21 中移信息技术有限公司 Test script recording method, application program testing method and related device
CN111985182A (en) * 2019-05-22 2020-11-24 西安诺瓦星云科技股份有限公司 File editing method, device and system and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108038134A (en) * 2017-11-20 2018-05-15 东软集团股份有限公司 The method, apparatus and storage medium and electronic equipment of page presentation
CN110716853A (en) * 2018-07-13 2020-01-21 中移信息技术有限公司 Test script recording method, application program testing method and related device
CN111985182A (en) * 2019-05-22 2020-11-24 西安诺瓦星云科技股份有限公司 File editing method, device and system and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
小圣_FIGHTING: "Linux下vi编辑器粘贴复制剪切功能", pages 1, Retrieved from the Internet <URL:《https://blog.csdn.net/xie_xiansheng/article/details/78206599》> *
网易AIRTESTPROJECT: "一篇文章带你快速上手Airtest", pages 1 - 17, Retrieved from the Internet <URL:《https://juejin.cn/post/6844903997074210824》> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113238742A (en) * 2021-06-17 2021-08-10 南方电网科学研究院有限责任公司 Method, device, terminal and medium for modifying and replaying direct-current control protection page program
CN113238742B (en) * 2021-06-17 2024-04-12 南方电网科学研究院有限责任公司 Direct current control page protection program modification playback method, device, terminal and medium

Similar Documents

Publication Publication Date Title
US20130007711A1 (en) Unified model for visual component testing
CN111881019B (en) User interface testing method and device
CN105335132B (en) Method, device and system for customizing application program function
CN104461895A (en) Editing method and system of testing sequence and automatic testing system
CN110716853A (en) Test script recording method, application program testing method and related device
CN111897740A (en) User interface testing method and device, electronic equipment and computer readable medium
CN104915297B (en) A kind of automated testing method of the APP power consumption of android equipment
CN105740138A (en) Test method, test device and test system of application
CN110162730B (en) Information processing method, information processing device, computer equipment and storage medium
CN105740144A (en) Automated testing method and system for Android mobile Terminal
CN105487752A (en) Application control method and terminal applying same
CN112015626A (en) User behavior recording method, device and equipment
CN106202327B (en) Picture display method and mobile terminal
CN112905441A (en) Test case generation method, test method, device and equipment
CN112463639A (en) Test script editing method, device and equipment
CN111435328B (en) Application testing method and device, electronic equipment and readable storage medium
CN110580221A (en) Control testing method and device, storage medium and electronic equipment
CN115712794A (en) Page management method and device, processor and electronic equipment
CN115268890A (en) Information processing method and device and electronic equipment
CN110968513B (en) Recording method and device of test script
CN112214404A (en) Mobile application testing method and device, storage medium and electronic equipment
CN108694115A (en) A kind of processing method, equipment and the system of webpage test
CN109684525B (en) Document display method and device, storage medium and test equipment
CN110888649B (en) Application deployment method, application baseline creation method and device
CN113220386A (en) Instrument board publishing method and related equipment

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