CN111694728A - Automatic generation method and device of script - Google Patents

Automatic generation method and device of script Download PDF

Info

Publication number
CN111694728A
CN111694728A CN202010289353.3A CN202010289353A CN111694728A CN 111694728 A CN111694728 A CN 111694728A CN 202010289353 A CN202010289353 A CN 202010289353A CN 111694728 A CN111694728 A CN 111694728A
Authority
CN
China
Prior art keywords
test
script
action
parameters
name
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
CN202010289353.3A
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.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data Technologies 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 New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN202010289353.3A priority Critical patent/CN111694728A/en
Publication of CN111694728A publication Critical patent/CN111694728A/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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

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

Abstract

The invention provides a method and a device for automatically generating scripts, wherein the method utilizes arranged test cases to obtain multiple groups of parameters in the test cases, further can automatically generate corresponding scripts according to preset script templates, realizes the generalization of the generated script templates through the unified arrangement of the test cases and the script templates corresponding to the arranged test cases, does not need to compile a large number of test scripts aiming at different test scenes, and has better universality.

Description

Automatic generation method and device of script
Technical Field
The present disclosure relates to network communication technologies, and in particular, to a method and an apparatus for automatically generating a script.
Background
In the current software product, before shipping, a User Interface (UI) of the software product needs to be tested to ensure the quality of the product.
In the automatic UI test, script developers directly write codes in the script file line by line according to test needs, a large number of test scripts are required to be written according to different test scenes, the universality is not high, the test efficiency is low, and the development and maintenance cost is increased.
Disclosure of Invention
The invention provides an automatic generation method and device of scripts, which are used for solving the problem that a large number of test scripts are required to be written in different test scenes in the existing automatic UI test, and the universality is not high.
In order to realize the above purpose, the embodiment of the present disclosure adopts the following technical solutions:
in a first aspect, an embodiment of the present disclosure provides a method for automatically generating a script, where the method includes:
acquiring multiple groups of parameters corresponding to the functional modules in the test cases, wherein each group of parameters comprises multiple parameters, and the multiple parameters comprise: a name of a test action, input parameters associated with the test action; wherein the plurality of parameters are arranged in a preset sequence;
inputting each group of parameters into a preset script template to generate script codes corresponding to the group of parameters; and the script template comprises an execution identifier used for indicating to execute the action class corresponding to the name of the test action.
Optionally, the method further includes: when receiving an automatic test instruction aiming at the functional module, acquiring a plurality of groups of script codes corresponding to the functional module;
for each group of script codes, identifying test action names in the script codes; calling an action class corresponding to the test action name according to the test action name; and transmitting the input parameters to the action class, searching a control corresponding to the input parameters on a UI (user interface) according to the input parameters, executing the test action corresponding to the test name according to the control, and outputting the execution result of the test action corresponding to each group of script codes.
Optionally, the parameters further include a dependency relationship between the test action and another test action;
correspondingly, the method further comprises the following steps:
for each group of script codes, identifying the test action name in the script codes and acquiring the script code execution result with the dependency relationship with the group of script codes; calling an action class corresponding to the test action name according to the test action name; and transmitting the input parameters and the execution result to the action class, and if the execution result is determined to be not in accordance with the execution condition of the action class, not executing the test action corresponding to the test name.
Optionally, the input parameters include path information, and the path information is used to search for a control corresponding to another input parameter included in the input parameters on a UI interface.
Optionally, the generated script code further includes a dependency relationship identifier, where the dependency relationship identifier is used to obtain an execution result of the script code having a dependency relationship with the current script.
In a second aspect, an embodiment of the present disclosure provides an apparatus for automated generation of a script, the apparatus comprising:
an obtaining module, configured to obtain multiple sets of parameters corresponding to the functional modules in the test case, where each set of parameters includes multiple parameters, and the multiple parameters include: a name of a test action, input parameters associated with the test action; wherein the plurality of parameters are arranged in a preset sequence;
the generating module is used for inputting each group of parameters into a preset script template and generating script codes corresponding to the group of parameters; and the script template comprises an execution identifier used for indicating to execute the action class corresponding to the name of the test action.
Optionally, the apparatus further comprises:
the receiving module is used for acquiring a plurality of groups of script codes corresponding to the functional modules when receiving the automatic test instruction aiming at the functional modules;
the calling module is used for identifying the test action name in the script code aiming at each group of script codes; calling an action class corresponding to the test action name according to the test action name; and transmitting the input parameters to the action class, searching a control corresponding to the input parameters on a UI (user interface) according to the input parameters, executing the test action corresponding to the test name according to the control, and outputting the execution result of the test action corresponding to each group of script codes.
Optionally, the input parameters acquired by the acquisition module include path information, and the path information is used to search for a control corresponding to another input parameter included in the input parameters on a UI interface.
Optionally, the script code generated by the generating module further includes a dependency relationship identifier, where the dependency relationship identifier is used to obtain an execution result of the script code having a dependency relationship with the current script.
According to the automatic generation method and device of the script, the arranged test cases are utilized to obtain multiple groups of parameters in the test cases, the corresponding script can be further automatically generated according to the preset script template, the generated script template is generalized through unified arrangement of the test cases and the script template corresponding to the arranged test cases, a large number of test scripts do not need to be compiled aiming at different test scenes, and the universality is good.
Drawings
Fig. 1 is a schematic flowchart illustrating a method for automatically generating a script according to an embodiment of the present disclosure;
FIG. 2 is a schematic structural diagram of an apparatus for automatically generating a script according to yet another embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a network device according to another embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Aiming at the problems that in the prior art, a script developer needs to compile a large number of test scripts aiming at different test scenes and the universality is not high, the method disclosed by the invention firstly utilizes the arranged test cases to obtain a plurality of groups of parameters in the test cases, further can automatically generate corresponding scripts according to the preset script templates, realizes the generalization of the generated script templates through the uniform arrangement of the test cases and the script templates corresponding to the arranged test cases, does not need to compile a large number of test scripts aiming at different test scenes, and has better universality.
Example one
The present disclosure will specifically introduce the method for automatically generating a script provided by the present disclosure, and fig. 1 is a schematic flow chart of the method for automatically generating a script provided by the present disclosure, as shown in fig. 1, the method includes:
step 202, obtaining multiple sets of parameters corresponding to the functional modules in the test case, where each set of parameters includes multiple parameters, and the multiple parameters include: a name of a test action, input parameters associated with the test action; wherein the plurality of parameters are arranged in a preset order.
The functional module in this embodiment may be software that can implement multiple sub-functions, or may also be a functional module that can implement a certain sub-function in a software product, and the scope of the functional module is not limited in this embodiment. For example, the function module may be software for Application monitoring, and for example, may be an APM (Application performance management), in which sub-functions such as Application detection, alarm, and the like are included. The automatic generation method of the script in the disclosure can be applied to the whole APM software and also can be applied to a certain sub-function independently. The application scenario of the method is not limited in the present disclosure.
Whether the monitoring software or the sub-functions of the monitoring software are implemented, the corresponding functions are generally implemented by a plurality of actions. In the present disclosure, a functional module is taken as an example to implement a login function.
The login function of the software is realized by a series of operations of inputting a user name, inputting a password, clicking a login button and inquiring whether the login is successful or not. Correspondingly, the function of realizing software login comprises a plurality of groups of parameters in the test case. An illustration of the test case is given in table 1. As shown in Table 1, the test case includes 8 sets of parameters corresponding to A1\ B1\ C1\ D1\ A2\ B2\ C2\ D2. Wherein, the letters (e.g. a \ B \ C \ D in the header row) represent the row coordinates of the test case, and the numbers (e.g. corresponding 1 and 2 in the header column) represent the column coordinates.
The plurality of parameters included in each group of parameters may specifically include:
(1) a test action;
for example, "input" included in a1, "input" included in B1, "click" included in C1, "query" included in D1;
(2) input parameters associated with the test action;
the input parameters generally include a path of a label element corresponding to the test action on the UI interface, and the input parameters may include Xpath. For the operation of entering a user name, the input parameter may further include a user password. The number of input parameters is determined according to the actual test environment, and the method of the present disclosure does not limit this.
(3) Dependencies between actions;
since there are dependencies between many test actions, e.g., action 1 is "switch to page B", action 2 is "click button C in page B", the click of action 2 depends on the success of switching page B in action 1, and if action 1 is not performed successfully, action 2 will also fail. Optionally, the parameters of the test case may further include a dependency relationship between the test action and another test action.
(4) Description information of the action;
because the test case is convenient for the tester to use, optionally, the parameters of the test case may further include: the description information of the action, for example, the parameters corresponding to B1 and B2 in table 1 may include description information of "inputting an incorrect password" and "inputting a correct password", so as to describe the relevant action and parameters or the execution result corresponding to the action.
In the test case, a plurality of parameters in each group of parameters are arranged according to a preset sequence, and the parameters in different groups are also arranged according to the same sequence; for example, the first row of the test case may be description information of an action, the second row may be a name of a test action, the third row may be an input parameter, and the fourth row may be a dependency relationship between the test action and other test actions.
The purpose of arranging the plurality of parameters in the preset order is to input the parameters into the script template in order, thereby generating the script code.
TABLE 1
Figure BDA0002449798120000061
The test case may be stored in Excel, so as to facilitate establishing an ID of the test action by using coordinates of Excel, for example, coordinates of an Excel cell may be used as an ID of the action. Of course, the test case can also be stored in Word, and the mode of storing the test case is not limited in the present disclosure as long as the ordered arrangement among the parameters is ensured.
Step 204, inputting each group of parameters into a preset script template to generate script codes corresponding to the group of parameters; and the script template comprises an execution identifier used for indicating to execute the action class corresponding to the name of the test action.
Each group of parameters may generate a line of script, and for each group of parameters, fill a plurality of parameters included in the group of parameters into a preset script template.
An example of a script template is, for example:
execution identification
[ action name ] [ input parameter ] [ action execution result ]
For convenience of explanation, the script template is explained by taking the example shown in table 1 as an example, and the test script generated after the parameters corresponding to the group a1 in table 1 are input into the script template may be a script in the following form:
Run Action
m ═ input ] N ═ parameter 11, parameter 12 ═ M ═ input ═ N ═ parameter 12-
When an automation test instruction is received, if a Run Action is identified, an Action class corresponding to the Action input is executed. Of course, the script code also includes other necessary information, for example, the execution result of the script is returned by using the return, and this portion may be the same as the prior art, and is not described herein again. How to execute subsequent automatic test execution is specifically described in the following embodiment two, which is not repeated in this embodiment.
According to the automatic script generation method provided by the disclosure, the arranged test cases are utilized to obtain multiple groups of parameters in the test cases, further, corresponding scripts can be automatically generated according to the preset script templates, through the unified arrangement of the test cases and the script templates corresponding to the arranged test cases, the generated script templates are generalized, a large number of test scripts do not need to be compiled aiming at different test scenes, and the universality is good.
Example two
On the basis of the first embodiment, the present embodiment describes how to perform automatic testing according to the test script after the test script is generated.
After a test script is generated, when an automatic test instruction for the functional module is received, acquiring a plurality of groups of script codes corresponding to the functional module;
in this embodiment, a description will be given by taking a single script code (i.e., a script code corresponding to one action) of a plurality of sets of script codes as an example.
Identifying a test action name in the script code; for example, if the test action name is recognized as "input", the action class 1 corresponding to the "input" is called based on the test action name "input", and the input parameters (for example, parameters 11 and 12) are passed to the action class 1. After the input parameters are transferred to the action class, a control (the control may be an input frame or a click frame) corresponding to the input parameters on the UI interface may be searched according to the input parameters, the test action corresponding to the test name is executed according to the control, and the execution result of the test action corresponding to each set of script codes is output.
Generally, the input parameters include a plurality of sub-parameters and path information corresponding to each sub-parameter. For example, if the parameter 11 is a user name, the parameter 12 may be path information of a control corresponding to the user name on the UI interface, and a control for inputting the user name may be found on the UI according to the path information, and then the user name is filled in the control. And after the user name is filled in the control, outputting an execution result.
By executing the generated script, the Action class corresponding to the test Action can be called according to the instruction of the Run Action of the script test Action, and the execution result corresponding to the test Action is output. Because the standardization of the test script is unified, the test efficiency can be improved.
EXAMPLE III
In an automated test, if it is desired that after an action fails to be executed, none of the associated actions is executed or other actions are executed, a script developer needs to determine, according to personal experience, the execution results of all the actions, find all the associated actions among the actions, and add codes of corresponding processing methods one by one. In the current implementation mode, a large amount of codes are added in a script, in a huge system, a script developer searches actions one by one in the script to establish the association relationship among massive actions, and the association relationship is difficult to implement undoubtedly and difficult to maintain in the later period.
In the above automatic generation method of a script according to the present disclosure, if execution of one test action 1 depends on success or failure of execution of another test action 2, a dependency relationship between the test action and another test action may be added to a parameter corresponding to the test case and the test action 1.
Correspondingly, the generated script includes a dependency relationship identifier, and the dependency relationship identifier is used to obtain an execution result of the script code having a dependency relationship with the current script.
Examples of script templates are:
execution identification
Action name input parameter action execution result test action execution result dependent on action
For convenience of explanation, the script template is explained by taking the example shown in table 1 as an example, and the test script generated after the parameters corresponding to the group D1 in table 1 are input into the script template may be a script in the following form:
Run Action
m ═ query ═ N ═ parameter 17, parameter 18] Q ═ C1]
Where C1 ═ T indicates that the execution result of C1 is successful, and M, N, Q respectively identifies the identifiers of the parameters, that is, the identifier of the test action, the identifier of the input parameter, and the identifier of the execution result of the test action having a dependency relationship. C1 is a dependency identifier indicating that the current script code has a dependency relationship with the script code corresponding to C1. In particular, can be according to
Of course, for the test action corresponding to a2 in table 1, when Q is ═ D1 ═ F ] in the dependency, this indicates that the execution of the method class corresponding to "input" is triggered only when the output result of the action D1 having a dependency is a login failure.
Other values may also be used to indicate that the current test action is not dependent on other actions, and may also indicate that the current test action is automatically dependent on the last executed test action, i.e. whether the execution result of the last executed test action is successful or not, the execution of the current test action is triggered. The representation of the dependency relationships in this disclosure is not limited.
Correspondingly, when an automatic test instruction is received, the test action name in the script code can be identified, and whether other script codes with dependency relationship exist in the group of script codes is judged; if the script codes exist, acquiring the test action names in the script codes and acquiring other script code execution results which have a dependency relationship with the group of script codes; and transmitting the input parameters and the execution result to the action class, and if the execution result is determined to be unsuccessful, not executing the test action corresponding to the test name.
Therefore, after receiving the automated execution instruction for the function module, taking whether the query login in table 1 is successful as an example, whether the query login corresponding to D1 is successful depends on whether the click login button of C1 is successfully executed, that is, whether the query login is successful depends on the click login button. After testing the login process of A1-D1 with wrong password, the execution of the "enter" username of A2 is triggered depending on the failure of the execution result of D1. When the script code corresponding to the "input" username of a2 is executed, the execution result of whether the "query" login of the input parameter 21 and the parameter 22 and the D1 is successful is transmitted to the action class corresponding to the "input", and if the query result of whether the "query" login is successful is login failure, the test action of the input username corresponding to a2 is executed.
Wherein the action name is tested and retrieved in a specific retrieval script code
In the method provided by the disclosure, the dependency relationship among the test actions is maintained in the arranged scripts, the scripts with the dependency relationship can be automatically generated, and the execution of the scripts with the dependency relationship can be automatically triggered during the automatic test, so that a script developer does not need to add codes of corresponding processing methods one by one after finding all the associated actions among the actions like the prior art.
Example four
Fig. 3 is a schematic structural diagram of an automatic generation apparatus for a script according to yet another embodiment of the present disclosure. As shown in fig. 3, the apparatus includes:
an obtaining module 510, configured to obtain multiple sets of parameters corresponding to function modules in a test case, where each set of parameters includes multiple parameters, and the multiple parameters include: a name of a test action, input parameters associated with the test action; wherein the plurality of parameters are arranged in a preset sequence;
a generating module 520, configured to input each set of parameters into a preset script template, and generate a script code corresponding to the set of parameters; and the script template comprises an execution identifier used for indicating to execute the action class corresponding to the name of the test action.
Optionally, the apparatus may further include a receiving module and a calling module (not shown in the figure),
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for acquiring a plurality of groups of script codes corresponding to the functional modules when receiving an automatic test instruction aiming at the functional modules;
the calling module is used for identifying the test action name in the script code aiming at each group of script codes; calling an action class corresponding to the test action name according to the test action name; and transmitting the input parameters to the action class, searching a control corresponding to the input parameters on a UI (user interface) according to the input parameters, executing the test action corresponding to the test name according to the control, and outputting the execution result of the test action corresponding to each group of script codes.
Optionally, the calling module is further configured to, in a case that the plurality of parameters further include a dependency relationship between a test action and another test action, identify, for each group of script codes, a test action name in the script code, and obtain a script code execution result having a dependency relationship with the group of script codes; calling an action class corresponding to the test action name according to the test action name; and transmitting the input parameters and the execution result to the action class, and if the execution result is determined to be not in accordance with the execution condition of the action class, not executing the test action corresponding to the test name.
Optionally, the input parameters acquired by the acquisition module include path information, and the path information is used to search for a control corresponding to another input parameter included in the input parameters on a UI interface.
Optionally, the script code generated by the generating module further includes a dependency relationship identifier, where the dependency relationship identifier is used to obtain an execution result of the script code having a dependency relationship with the current script.
The present disclosure further provides a network device 60, and fig. 3 is a schematic structural diagram of a network device according to another embodiment of the present disclosure, as shown in fig. 3, the network device 60 includes a processor 601 and a memory 602, where the memory 602 is configured to store script codes, and the processor 601 is configured to call the script codes stored in the memory, and when the processor 601 executes program instructions stored in the memory 602, is configured to perform an automated test of a UI interface. The process of the automatic test is similar to the execution flow after receiving the automatic test instruction in the second embodiment and the third embodiment, and is not described again here.
In the embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present disclosure may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solution of the present disclosure or portions thereof that contribute to the prior art in essence can be embodied in the form of a software product, which is stored in a readable storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present disclosure. And the aforementioned readable storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only exemplary of the present disclosure and should not be taken as limiting the disclosure, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (10)

1. A method for automated generation of scripts, the method comprising:
acquiring multiple groups of parameters corresponding to the functional modules in the test cases, wherein each group of parameters comprises multiple parameters, and the multiple parameters comprise: a name of a test action, input parameters associated with the test action; wherein the plurality of parameters are arranged in a preset sequence;
inputting each group of parameters into a preset script template to generate script codes corresponding to the group of parameters; and the script template comprises an execution identifier used for indicating to execute the action class corresponding to the name of the test action.
2. The method according to claim 1, characterized in that it comprises:
when receiving an automatic test instruction aiming at the functional module, acquiring a plurality of groups of script codes corresponding to the functional module;
for each group of script codes, identifying test action names in the script codes; calling an action class corresponding to the test action name according to the test action name; and transmitting the input parameters to the action class, searching a control corresponding to the input parameters on a UI (user interface) according to the input parameters, executing the test action corresponding to the test name according to the control, and outputting the execution result of the test action corresponding to each group of script codes.
3. The method of claim 2, wherein the plurality of parameters further includes a dependency relationship of a test action on other test actions;
correspondingly, the method further comprises the following steps:
for each group of script codes, identifying the test action name in the script codes and acquiring the script code execution result with the dependency relationship with the group of script codes; calling an action class corresponding to the test action name according to the test action name; and transmitting the input parameters and the execution result to the action class, and if the execution result is determined to be not in accordance with the execution condition of the action class, not executing the test action corresponding to the test name.
4. The method of claim 1, wherein the input parameters include path information, and wherein the path information is used to find controls on a UI interface corresponding to other input parameters included in the input parameters.
5. The method according to claim 3, wherein the generated script code further comprises a dependency relationship identifier, and the dependency relationship identifier is used for obtaining an execution result of the script code having a dependency relationship with the current script.
6. An apparatus for automated generation of scripts, the apparatus comprising:
an obtaining module, configured to obtain multiple sets of parameters corresponding to the functional modules in the test case, where each set of parameters includes multiple parameters, and the multiple parameters include: a name of a test action, input parameters associated with the test action; wherein the plurality of parameters are arranged in a preset sequence;
the generating module is used for inputting each group of parameters into a preset script template and generating script codes corresponding to the group of parameters; and the script template comprises an execution identifier used for indicating to execute the action class corresponding to the name of the test action.
7. The apparatus of claim 6, further comprising:
the receiving module is used for acquiring a plurality of groups of script codes corresponding to the functional modules when receiving the automatic test instruction aiming at the functional modules;
the calling module is used for identifying the test action name in the script code aiming at each group of script codes; calling an action class corresponding to the test action name according to the test action name; and transmitting the input parameters to the action class, searching a control corresponding to the input parameters on a UI (user interface) according to the input parameters, executing the test action corresponding to the test name according to the control, and outputting the execution result of the test action corresponding to each group of script codes.
8. The apparatus according to claim 7, wherein the invoking module is further configured to, in a case that a dependency relationship between the test action and other test actions is further included in the plurality of parameters, for each group of script codes, identify a name of the test action in the script code and obtain a script code execution result having a dependency relationship with the group of script codes; calling an action class corresponding to the test action name according to the test action name; and transmitting the input parameters and the execution result to the action class, and if the execution result is determined to be not in accordance with the execution condition of the action class, not executing the test action corresponding to the test name.
9. The apparatus according to claim 6, wherein the input parameters obtained by the obtaining module include path information, and the path information is used to find a control corresponding to another input parameter included in the input parameters on a UI interface.
10. The apparatus according to claim 8, wherein the script code generated by the generating module further includes a dependency identifier, and the dependency identifier is used to obtain an execution result of the script code having a dependency relationship with the current script.
CN202010289353.3A 2020-04-14 2020-04-14 Automatic generation method and device of script Pending CN111694728A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010289353.3A CN111694728A (en) 2020-04-14 2020-04-14 Automatic generation method and device of script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010289353.3A CN111694728A (en) 2020-04-14 2020-04-14 Automatic generation method and device of script

Publications (1)

Publication Number Publication Date
CN111694728A true CN111694728A (en) 2020-09-22

Family

ID=72476306

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010289353.3A Pending CN111694728A (en) 2020-04-14 2020-04-14 Automatic generation method and device of script

Country Status (1)

Country Link
CN (1) CN111694728A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138635A (en) * 2021-11-17 2022-03-04 广州新丝路信息科技有限公司 Automatic test script generation method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138635A (en) * 2021-11-17 2022-03-04 广州新丝路信息科技有限公司 Automatic test script generation method and device

Similar Documents

Publication Publication Date Title
CN110297774B (en) Automatic interface testing method based on python
CN107665171B (en) Automatic regression testing method and device
CN112148610A (en) Test case execution method and device, computer equipment and storage medium
CN110543427B (en) Test case storage method and device, electronic equipment and storage medium
CN110532182B (en) Automatic testing method and device for virtualization platform
CN110968509A (en) Method and system for batch customizing of variables
CN111124872A (en) Branch detection method and device based on difference code analysis and storage medium
CN113049935A (en) Semiconductor intelligent detection system, intelligent detection method and storage medium
CN111367782B (en) Regression testing data automatic generation method and device
CN111694728A (en) Automatic generation method and device of script
CN117290250A (en) Automatic test framework establishment method, computer equipment and computer storage medium
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN116431522A (en) Automatic test method and system for low-code object storage gateway
CN110806973A (en) Automatic generation method and device of interface message
CN113886221B (en) Test script generation method and device, storage medium and electronic equipment
CN111400245B (en) Art resource migration method and device
CN111459984B (en) Log data processing system and method based on streaming processing
CN115705297A (en) Code call detection method, device, computer equipment and storage medium
CN114116253A (en) Message processing method and system for message queue
CN115878448A (en) Database test method, distributed database and storage medium
CN113778450A (en) Processing method, device and equipment for dependency conflict and storage medium
CN113641523B (en) Log processing method and device
CN114900339B (en) Intrusion detection method, intrusion detection system, intrusion detection equipment and storage medium
CN112948244B (en) Method, device and equipment for industrial internet information model test
CN117171364B (en) Operation and maintenance knowledge graph updating method and device

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