CN110764746A - Script generation method and device and computer readable storage medium - Google Patents

Script generation method and device and computer readable storage medium Download PDF

Info

Publication number
CN110764746A
CN110764746A CN201911003492.9A CN201911003492A CN110764746A CN 110764746 A CN110764746 A CN 110764746A CN 201911003492 A CN201911003492 A CN 201911003492A CN 110764746 A CN110764746 A CN 110764746A
Authority
CN
China
Prior art keywords
script
execution
driver
recording
data
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.)
Granted
Application number
CN201911003492.9A
Other languages
Chinese (zh)
Other versions
CN110764746B (en
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.)
China Merchants Finance Technology Co Ltd
Original Assignee
China Merchants Finance 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 China Merchants Finance Technology Co Ltd filed Critical China Merchants Finance Technology Co Ltd
Priority to CN201911003492.9A priority Critical patent/CN110764746B/en
Publication of CN110764746A publication Critical patent/CN110764746A/en
Application granted granted Critical
Publication of CN110764746B publication Critical patent/CN110764746B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/313Logic programming, e.g. PROLOG programming language
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a data testing technology, and discloses a script generation method, which comprises the following steps: receiving project testing requirements of a user, generating a driver according to the project testing requirements, and performing parameter configuration on the driver; if an abnormal condition occurs when the driver parameters are configured, returning the abnormal condition to the user; if the driver parameters are kept normal during configuration, generating a script plan, wherein the script plan comprises an execution script and a recording script; and running the execution script, recording the running log of the execution script through the recording script, and returning the running log to the user. The invention realizes the generation of the script.

Description

Script generation method and device and computer readable storage medium
Technical Field
The present invention relates to the field of data testing technologies, and in particular, to a script generation method and apparatus, and a computer-readable storage medium.
Background
In the testing of a software project, defects of the software project are usually discovered through a test script. The same set of test scripts may need to appear at different times and under different test scenes, and different test tasks are configured according to the different times and different test scenes. Because the obtained time or scene parameters are different, code redundancy of the test script is easily caused, and the script of a certain test task is easily missed when the logic is adjusted.
Disclosure of Invention
The invention provides a script generation method, a script generation device and a computer readable storage medium, and mainly aims to provide an intelligent script generation scheme.
In order to achieve the above object, the present invention provides a script generating method, including:
receiving project testing requirements of a user, generating a driver according to the project testing requirements, and performing parameter configuration on the driver;
if an abnormal condition occurs when the driver parameters are configured, returning the abnormal condition to the user;
if the driver parameters are kept normal during configuration, generating a script plan, wherein the script plan comprises an execution script and a recording script;
and running the execution script, recording the running log of the execution script through the recording script, and returning the running log to the user.
Optionally, the driver includes a firmware build script and an execution main program script, wherein the firmware build script includes parameter definition and logic control, and the execution main program script includes an entry for script execution.
Optionally, the generating the script plan includes:
creating an execution script file with a data format, and loading the execution main program script and the firmware construction script into the execution script file;
and creating a recording script file of the text data, and connecting the recording script file with the loaded execution script file to obtain the script plan.
Optionally, the configuring the parameters of the driver includes: configuring driving parameters and script data of the driver;
calling corresponding codes, web pages and drive parameters of hardware according to the project test requirements, loading the corresponding codes, web pages and drive parameters of the hardware into the driver, and completing configuration of the drive parameters;
and configuring the script data for the driver according to the data type of the script data.
Optionally, the recording, by the recording script, a running log of the execution script includes:
and acquiring an interface of the execution script, accessing the interface to obtain an operation log of the execution script, and recording the operation log according to the logging function of the recording script.
In order to achieve the above object, the present invention further provides a script generating apparatus including a memory and a processor, wherein the memory stores a script generating program executable on the processor, and the script generating program, when executed by the processor, implements the steps of:
receiving project testing requirements of a user, generating a driver according to the project testing requirements, and performing parameter configuration on the driver;
if an abnormal condition occurs when the driver parameters are configured, returning the abnormal condition to the user;
if the driver parameters are kept normal during configuration, generating a script plan, wherein the script plan comprises an execution script and a recording script;
and running the execution script, recording the running log of the execution script through the recording script, and returning the running log to the user.
Optionally, the driver includes a firmware build script and an execution main program script, wherein the firmware build script includes parameter definition and logic control, and the execution main program script includes an entry for script execution.
Optionally, the generating the script plan includes:
creating an execution script file with a data format, and loading the execution main program script and the firmware construction script into the execution script file;
and creating a recording script file of the text data, and connecting the recording script file with the loaded execution script file to obtain the script plan.
Optionally, the configuring the parameters of the driver includes: configuring driving parameters and script data of the driver;
calling corresponding codes, web pages and drive parameters of hardware according to the project test requirements, loading the corresponding codes, web pages and drive parameters of the hardware into the driver, and completing configuration of the drive parameters;
and configuring the script data for the driver according to the data type of the script data.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a script generation program, which is executable by one or more processors to implement the steps of the script generation method as described above.
The script generation method, the device and the computer readable storage medium provided by the invention receive the project test requirements of the user to generate the driver, configure the driving parameters and the script data for the driver, and generate the script plan according to the configured driver under the test of different software projects, thereby reducing the code redundancy of the script, effectively monitoring the omission condition of the test task, and presenting the running result of the comprehensive and efficient software test for the user.
Drawings
Fig. 1 is a schematic flowchart of a script generation method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an internal structure of a script generating apparatus according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of a script generation program in the script generation apparatus according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a script generation method. Fig. 1 is a schematic flowchart of a script generation method according to an embodiment of the present invention. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the script generation method includes:
s1, receiving project test requirements of a user, generating a driver according to the project test requirements, and performing parameter configuration on the driver.
In the preferred embodiment of the present invention, the project test requirement refers to the purpose to be achieved by the function test, the module test, the interface test, and the like of one software project. For example, if the project is an e-commerce platform, the project testing requirement may be: whether the login interface of the e-commerce platform is normally connected, whether a product classification module of the e-commerce platform can automatically purchase a product, whether background database connection of the e-commerce platform is normal, and the like.
Preferably, the driver in the present invention is a test script compiled by Python language. The driver comprises a firmware building script and an execution main program script. The firmware construction script comprises parameter definitions and logic controls, wherein the parameter definitions comprise definition of int for integer data and float for float, and the logic controls comprise definition of circulation logic and judgment logic. The executing main program script includes an entry for script execution, such as a main () function.
Preferably, the present invention configures parameters of the driver through a script management system, wherein the script management system is a system that manages all scripts according to a certain storage format through a search scheme using certain criteria. Wherein the search scheme may be similar to a search method of searching data of a database, and the storage format may be stored in a binary method.
Further, the parameter configuration of the driver in the present invention includes: configuration of drive parameters and script data. And calling corresponding codes, web pages and drive parameters of hardware according to the project test requirements. For example, if the project test requirement is a test of compatibility of a newly developed web browser to each version of operating system, the script management system loads the driving parameters to be used into the driver according to the project requirement of the compatibility test of each version of operating system, where the driving parameters may be a code for calling a virtual machine, a web page in the newly developed web browser, and a headset sound parameter. Furthermore, the driving parameters can be saved in the execution main program script by using a JSON data format, so that the execution main program script can be directly called conveniently. The JSON is a lightweight data exchange format, and provides a standard, simple, easy-to-use and reliable data exchange format for data interaction of a front background and a back background such as a webpage and a server.
Further, the script data includes a data type required by the firmware building script, and the script management system is used for configuring the script data for the driver according to the data type. For example, the project test requirement is a test of compatibility of a newly developed web browser to operating systems of various versions, three integer data (int) A, B, C and one character data (string) D are defined in the firmware construction script, the script management system automatically configures the script data according to the defined three integer data A, B, C, for example, values of the configured integer data a can be 4 different numbers, which are 0, 1, 2 and 3, wherein when a is 0, Windows XP is represented, Windows Win7 is represented by 1, and Mac OS is represented by 2 and Linux is represented by 3; b represents whether the voice is called or not, 0 represents that the voice is successfully called, and 1 represents that the voice calling fails; c represents whether the headset is successfully called or not, 0 represents success, and 1 represents table failure; the character type D may be represented as web address information, such as: www.baidu.com, www.taobao.com, etc.
And S2, if an abnormal condition occurs when the driver parameters are configured, returning the abnormal condition to the user.
The exception condition includes configuring the script data exception and a driving parameter exception. For example: configuring the script data exception comprises using a plurality of different websites when testing the compatibility of each version of the operating system, so that the websites are necessarily character-shaped, but the script management system finds that the firmware construction script in the driver does not define character-shaped parameters, so that parameter definition exception occurs when the script data is configured, and the exception is returned to the user to help the user to modify the script data again.
And S3, if the driver parameters are kept normal during configuration, generating a script plan, wherein the script plan comprises an execution script and a recording script.
Preferably, the script plan of the present invention includes two data formats, one is an execution script that the computing device can execute in JSON data format, such as a py file; one is a recording script of text data, such as a txt-format file, which is used to feed back the running condition of the execution script to the user in real time, so that the user can know the running condition of the current script. Further, the execution script in the JSON data format includes the execution main program script and the firmware construction script in the configuration completion driver, and as can be seen from the foregoing S2, the parameters, functions, and the like in the firmware construction script are assigned, and the driving parameters required for executing the main program script are configured, so that the execution script in the JSON data format can be directly executed and generate the execution result.
Preferably, the generating of the script plan comprises: creating an execution script file A in a JSON data format, such as py; loading the execution main program script and the firmware construction script into the execution script file A; and creating a recording script file B of text data, and connecting the recording script file B with the loaded execution script file A through a connector, thereby generating the script plan. The connector is used for recording the running state and the running result of the execution file A in the running process in real time by the file B.
And S4, running the execution script, recording the running log of the execution script through the recording script, and returning the running log to the user.
In a preferred embodiment of the present invention, if an exception occurs during running of the execution script plan, the exception is recorded through the recording script, and an exception result is returned to the user, for example, the execution script plan cannot run normally due to collapse of a running environment, the exception occurring in the running environment part of the execution script is recorded through the recording script, and the exception is returned to the user, so that the user can be helped to find an error source; and if the execution script plan is operated, keeping normal operation, recording the operation result through the recording script, and returning the operation result to the user. In detail, the recording the execution log of the execution script by the recording script includes: and obtaining an interface of the execution script, accessing the interface through the connector to obtain an operation log of the execution script, and recording the operation log according to the logging function of the recording script. For example, for the compatibility test of a newly developed web browser to each version of operating system, after the execution script file a in the executable JSON data format is run, after the web browsers of operating systems such as Windows XP, Windows win7, Mac OS, Linux and the like are tested in sequence, the running log of the execution script file a in the JSON data format is recorded in real time through the recording script file B of text data, and the running log is returned to the user.
The invention also provides a script generation device. Fig. 2 is a schematic diagram illustrating an internal structure of a script generating apparatus according to an embodiment of the present invention.
In the present embodiment, the script generating apparatus 1 may be a PC (Personal Computer), a terminal device such as a smart phone, a tablet Computer, or a mobile Computer, or may be a server. The script generating apparatus 1 includes at least a memory 11, a processor 12, a communication bus 13, and a network interface 14.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the script generating apparatus 1, for example a hard disk of the script generating apparatus 1. The memory 11 may be an external storage device of the script generating apparatus 1 in other embodiments, such as a plug-in hard disk provided on the script generating apparatus 1, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 11 may also include both an internal storage unit of the script generating apparatus 1 and an external storage device. The memory 11 may be used not only to store application software installed in the script generating apparatus 1 and various types of data, such as a code of the script generating program 01, but also to temporarily store data that has been output or is to be output.
The processor 12 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 11 or Processing data, such as executing the script generating program 01.
The communication bus 13 is used to realize connection communication between these components.
The network interface 14 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), typically used to establish a communication link between the apparatus 1 and other electronic devices.
Optionally, the apparatus 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the script generation apparatus 1 and for displaying a visualized user interface.
While FIG. 2 shows only the script generating apparatus 1 having the components 11-14 and the script generating program 01, those skilled in the art will appreciate that the configuration shown in FIG. 1 is not limiting of the script generating apparatus 1 and may include fewer or more components than shown, or some components may be combined, or a different arrangement of components.
In the embodiment of the apparatus 1 shown in fig. 2, a script generation program 01 is stored in the memory 11; the processor 12 executes the script generating program 01 stored in the memory 11 to implement the following steps:
step one, receiving project test requirements of a user, generating a driver according to the project test requirements, and performing parameter configuration on the driver.
In the preferred embodiment of the present invention, the project test requirement refers to the purpose to be achieved by the function test, the module test, the interface test, and the like of one software project. For example, if the project is an e-commerce platform, the project testing requirement may be: whether the login interface of the e-commerce platform is normally connected, whether a product classification module of the e-commerce platform can automatically purchase a product, whether background database connection of the e-commerce platform is normal, and the like.
Preferably, the driver in the present invention is a test script compiled by Python language. The driver comprises a firmware building script and an execution main program script. The firmware construction script comprises parameter definitions and logic controls, wherein the parameter definitions comprise definition of int for integer data and float for float, and the logic controls comprise definition of circulation logic and judgment logic. The executing main program script includes an entry for script execution, such as a main () function.
Preferably, the present invention configures parameters of the driver through a script management system, wherein the script management system is a system that manages all scripts according to a certain storage format through a search scheme using certain criteria. Wherein the search scheme may be similar to a search method of searching data of a database, and the storage format may be stored in a binary method.
Further, the parameter configuration of the driver in the present invention includes: configuration of drive parameters and script data. And calling corresponding codes, web pages and drive parameters of hardware according to the project test requirements. For example, if the project test requirement is a test of compatibility of a newly developed web browser to each version of operating system, the script management system loads the driving parameters to be used into the driver according to the project requirement of the compatibility test of each version of operating system, where the driving parameters may be a code for calling a virtual machine, a web page in the newly developed web browser, and a headset sound parameter. Furthermore, the driving parameters can be saved in the execution main program script by using a JSON data format, so that the execution main program script can be directly called conveniently. The JSON is a lightweight data exchange format, and provides a standard, simple, easy-to-use and reliable data exchange format for data interaction of a front background and a back background such as a webpage and a server.
Further, the script data includes a data type required by the firmware building script, and the script management system is used for configuring the script data for the driver according to the data type. For example, the project test requirement is a test of compatibility of a newly developed web browser to operating systems of various versions, three integer data (int) A, B, C and one character data (string) D are defined in the firmware construction script, the script management system automatically configures the script data according to the defined three integer data A, B, C, for example, values of the configured integer data a can be 4 different numbers, which are 0, 1, 2 and 3, wherein when a is 0, Windows XP is represented, Windows Win7 is represented by 1, and Mac OS is represented by 2 and Linux is represented by 3; b represents whether the voice is called or not, 0 represents that the voice is successfully called, and 1 represents that the voice calling fails; c represents whether the headset is successfully called or not, 0 represents success, and 1 represents table failure; the character type D may be represented as web address information, such as: www.baidu.com, www.taobao.com, etc.
And step two, if an abnormal condition occurs when the driver parameters are detected to be configured, returning the abnormal condition to the user.
The exception condition includes configuring the script data exception and a driving parameter exception. For example: configuring the script data exception comprises using a plurality of different websites when testing the compatibility of each version of the operating system, so that the websites are necessarily character-shaped, but the script management system finds that the firmware construction script in the driver does not define character-shaped parameters, so that parameter definition exception occurs when the script data is configured, and the exception is returned to the user to help the user to modify the script data again.
And step three, if the driver parameters are kept normal during configuration, generating a script plan, wherein the script plan comprises an execution script and a recording script.
Preferably, the script plan of the present invention includes two data formats, one is an execution script that the computing device can execute in JSON data format, such as a py file; one is a recording script of text data, such as a txt-format file, which is used to feed back the running condition of the execution script to the user in real time, so that the user can know the running condition of the current script. Further, the execution script in the JSON data format includes the execution main program script and the firmware construction script in the configuration completion driver, and as can be seen from the above step two, the parameters, functions, and the like in the firmware construction script are assigned, and the driving parameters required for executing the main program script are configured, so that the execution script in the JSON data format can be directly executed and generate an operation result.
Preferably, the generating of the script plan comprises: creating an execution script file A in a JSON data format, such as py; loading the execution main program script and the firmware construction script into the execution script file A; and creating a recording script file B of text data, and connecting the recording script file B with the loaded execution script file A through a connector, thereby generating the script plan. The connector is used for recording the running state and the running result of the execution file A in the running process in real time by the file B.
And step four, running the execution script, recording the running log of the execution script through the recording script, and returning the running log to the user.
In a preferred embodiment of the present invention, if an exception occurs during running of the execution script plan, the exception is recorded through the recording script, and an exception result is returned to the user, for example, the execution script plan cannot run normally due to collapse of a running environment, the exception occurring in the running environment part of the execution script is recorded through the recording script, and the exception is returned to the user, so that the user can be helped to find an error source; and if the execution script plan is operated, keeping normal operation, recording the operation result through the recording script, and returning the operation result to the user. In detail, the recording the execution log of the execution script by the recording script includes: and obtaining an interface of the execution script, accessing the interface through the connector to obtain an operation log of the execution script, and recording the operation log according to the logging function of the recording script. For example, for the compatibility test of a newly developed web browser to each version of operating system, after the execution script file a in the executable JSON data format is run, after the web browsers of operating systems such as Windows XP, Windows win7, Mac OS, Linux and the like are tested in sequence, the running log of the execution script file a in the JSON data format is recorded in real time through the recording script file B of text data, and the running log is returned to the user.
Alternatively, in other embodiments, the script generating program may be divided into one or more modules, and the one or more modules are stored in the memory 11 and executed by one or more processors (in this embodiment, the processor 12) to implement the present invention, where the module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions to describe the execution process of the script generating program in the script generating device.
For example, referring to fig. 3, a schematic diagram of program modules of a script generating program in an embodiment of the script generating apparatus of the present invention is shown, in this embodiment, the script generating program may be divided into a parameter configuration module 10, an exception module 20, a script plan generating module 30, and a running record generation status access code module 40, which exemplarily:
the parameter configuration module 10 is configured to: receiving project test requirements of a user, generating a driver according to the project test requirements, and performing parameter configuration on the driver.
The exception module 20 is to: and if an abnormal condition occurs when the driver parameters are configured, returning the abnormal condition to the user.
The script plan generating module 30 is configured to: and if the driver parameters are kept normal during configuration, generating a script plan, wherein the script plan comprises an execution script and a recording script.
The operation recording module 40 is configured to: and running the execution script, recording the running log of the execution script through the recording script, and returning the running log to the user.
The functions or operation steps of the above-mentioned parameter configuration module 10, exception module 20, script plan generation module 30, and operation recording module 40 when executed are substantially the same as those of the above-mentioned embodiment, and are not described again here.
Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, where a script generation program is stored on the computer-readable storage medium, and the script generation program is executable by one or more processors to implement the following operations:
receiving project testing requirements of a user, generating a driver according to the project testing requirements, and performing parameter configuration on the driver;
if an abnormal condition occurs when the driver parameters are configured, returning the abnormal condition to the user;
if the driver parameters are kept normal during configuration, generating a script plan, wherein the script plan comprises an execution script and a recording script;
and running the execution script, recording the running log of the execution script through the recording script, and returning the running log to the user.
The embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the script generating apparatus and method, and will not be described in detail herein.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method 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, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for script generation, the method comprising:
receiving project testing requirements of a user, generating a driver according to the project testing requirements, and performing parameter configuration on the driver;
if an abnormal condition occurs when the driver parameters are configured, returning the abnormal condition to the user;
if the driver parameters are kept normal during configuration, generating a script plan, wherein the script plan comprises an execution script and a recording script;
and running the execution script, recording the running log of the execution script through the recording script, and returning the running log to the user.
2. The script generation method of claim 1, wherein the driver comprises a firmware build script and an executing main program script, wherein the firmware build script comprises parameter definitions and logic controls, and the executing main program script comprises an entry for script execution.
3. The script generation method of claim 2, wherein said generating a script plan comprises:
creating an execution script file with a data format, and loading the execution main program script and the firmware construction script into the execution script file;
and creating a recording script file of the text data, and connecting the recording script file with the loaded execution script file to obtain the script plan.
4. The script generation method of claim 1, wherein said configuring parameters of a driver comprises: configuring driving parameters and script data of the driver;
calling corresponding codes, web pages and drive parameters of hardware according to the project test requirements, loading the corresponding codes, web pages and drive parameters of the hardware into the driver, and completing configuration of the drive parameters;
and configuring the script data for the driver according to the data type of the script data.
5. The script generation method according to any one of claims 1 to 4, wherein the recording a running log of the execution script by the recording script comprises:
and acquiring an interface of the execution script, accessing the interface to obtain an operation log of the execution script, and recording the operation log according to the logging function of the recording script.
6. A script generating apparatus comprising a memory and a processor, the memory having stored thereon a script generating program executable on the processor, the script generating program when executed by the processor implementing the steps of:
receiving project testing requirements of a user, generating a driver according to the project testing requirements, and performing parameter configuration on the driver;
if an abnormal condition occurs when the driver parameters are configured, returning the abnormal condition to the user;
if the driver parameters are kept normal during configuration, generating a script plan, wherein the script plan comprises an execution script and a recording script;
and running the execution script, recording the running log of the execution script through the recording script, and returning the running log to the user.
7. The script generating apparatus according to claim 6, wherein the driver comprises a firmware build script and an executing main program script, wherein the firmware build script comprises parameter definitions and logic controls, and the executing main program script comprises an entry for script execution.
8. The script generating apparatus of claim 7, wherein said generating a script plan comprises:
creating an execution script file with a data format, and loading the execution main program script and the firmware construction script into the execution script file;
and creating a recording script file of the text data, and connecting the recording script file with the loaded execution script file to obtain the script plan.
9. The script generating apparatus of claim 6, wherein said configuring the parameters of the driver comprises: configuring driving parameters and script data of the driver;
calling corresponding codes, web pages and drive parameters of hardware according to the project test requirements, loading the corresponding codes, web pages and drive parameters of the hardware into the driver, and completing configuration of the drive parameters;
and configuring the script data for the driver according to the data type of the script data.
10. A computer-readable storage medium having stored thereon a script generation program executable by one or more processors to implement the steps of the script generation method of any one of claims 1 to 5.
CN201911003492.9A 2019-10-21 2019-10-21 Script generation method and device and computer readable storage medium Active CN110764746B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911003492.9A CN110764746B (en) 2019-10-21 2019-10-21 Script generation method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911003492.9A CN110764746B (en) 2019-10-21 2019-10-21 Script generation method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110764746A true CN110764746A (en) 2020-02-07
CN110764746B CN110764746B (en) 2023-03-31

Family

ID=69331459

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911003492.9A Active CN110764746B (en) 2019-10-21 2019-10-21 Script generation method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110764746B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538770A (en) * 2020-04-21 2020-08-14 招商局金融科技有限公司 Data monitoring method and device, electronic equipment and readable storage medium
CN112395158A (en) * 2020-11-17 2021-02-23 北京乐我无限科技有限责任公司 Information processing method and device and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105204992A (en) * 2015-08-28 2015-12-30 努比亚技术有限公司 Test script generating device and method
CN107992428A (en) * 2018-01-03 2018-05-04 成都能通科技有限公司 The automatic test platform that a kind of Python is realized
CN109284115A (en) * 2017-07-20 2019-01-29 北京国双科技有限公司 A kind of method and device generating tracker script
CN110109831A (en) * 2019-04-24 2019-08-09 中科恒运股份有限公司 Automated test frame system, automated testing method and terminal device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105204992A (en) * 2015-08-28 2015-12-30 努比亚技术有限公司 Test script generating device and method
CN109284115A (en) * 2017-07-20 2019-01-29 北京国双科技有限公司 A kind of method and device generating tracker script
CN107992428A (en) * 2018-01-03 2018-05-04 成都能通科技有限公司 The automatic test platform that a kind of Python is realized
CN110109831A (en) * 2019-04-24 2019-08-09 中科恒运股份有限公司 Automated test frame system, automated testing method and terminal device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538770A (en) * 2020-04-21 2020-08-14 招商局金融科技有限公司 Data monitoring method and device, electronic equipment and readable storage medium
CN111538770B (en) * 2020-04-21 2023-03-31 招商局金融科技有限公司 Data monitoring method and device, electronic equipment and readable storage medium
CN112395158A (en) * 2020-11-17 2021-02-23 北京乐我无限科技有限责任公司 Information processing method and device and computer readable storage medium

Also Published As

Publication number Publication date
CN110764746B (en) 2023-03-31

Similar Documents

Publication Publication Date Title
CN111090437B (en) Application deployment method and device and computer readable storage medium
US11237844B2 (en) Method and apparatus for loading kernel module
US8438418B2 (en) Simplifying automated software maintenance of data centers
US10175954B2 (en) Method of processing big data, including arranging icons in a workflow GUI by a user, checking process availability and syntax, converting the workflow into execution code, monitoring the workflow, and displaying associated information
WO2019227708A1 (en) Online debugging apparatus and method for test case, and computer-readable storage medium
CN110825619A (en) Automatic generation method and device of interface test case and storage medium
CN107526676B (en) Cross-system test method and device
CN108197024B (en) Embedded browser debugging method, debugging terminal and computer readable storage medium
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN110764746B (en) Script generation method and device and computer readable storage medium
CN111414234A (en) Mirror image container creation method and device, computer device and storage medium
CN115658529A (en) Automatic testing method for user page and related equipment
CN111367802B (en) Web automatic test method, device and computer readable storage medium
CN110727425A (en) Electronic device, form data verification method and computer-readable storage medium
CN110941779A (en) Page loading method and device, storage medium and electronic equipment
CN110688096A (en) Method, device, medium and electronic equipment for constructing application program containing plug-in
CN111552463A (en) Page jump method and device, computer equipment and storage medium
CN109597952B (en) Webpage information processing method, system, electronic equipment and storage medium
CN116974929A (en) Automatic test tool construction method, automatic test method and related equipment thereof
CN110737707A (en) Multi-system log searching method and device and computer readable storage medium
CN109828752B (en) Project code automatic generation method, device, computer equipment and storage medium
CN114115855A (en) Code multiplexing method and device, computer readable storage medium and electronic equipment
CN110825795A (en) Method, device and equipment for accessing database and computer readable storage medium
CN114595106B (en) Service control equipment debugging method and device
CN116302847B (en) Dynamic acquisition method and device of abnormal information, computer equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant