CN117076297A - Automatic test method, device, equipment and storage medium - Google Patents
Automatic test method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN117076297A CN117076297A CN202310990167.6A CN202310990167A CN117076297A CN 117076297 A CN117076297 A CN 117076297A CN 202310990167 A CN202310990167 A CN 202310990167A CN 117076297 A CN117076297 A CN 117076297A
- Authority
- CN
- China
- Prior art keywords
- case
- text
- test
- generating
- execution
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000010998 test method Methods 0.000 title claims abstract description 18
- 238000012360 testing method Methods 0.000 claims abstract description 190
- 238000013515 script Methods 0.000 claims abstract description 55
- 230000014509 gene expression Effects 0.000 claims description 15
- 238000012545 processing Methods 0.000 claims description 13
- 238000000034 method Methods 0.000 description 24
- 230000008569 process Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 11
- 238000004891 communication Methods 0.000 description 5
- 239000000284 extract Substances 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 230000009471 action Effects 0.000 description 2
- 230000006399 behavior Effects 0.000 description 2
- 241001174924 Pytho Species 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Computer Hardware Design (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application discloses an automatic test method, an automatic test device, automatic test equipment and a storage medium, wherein the automatic test method comprises the following steps: acquiring case parameter information input by a user on a case parameter input interface; generating a case text of the natural language description according to the case parameter information; text analysis is carried out on the case text, and a test script is generated according to the text analysis result; executing the test script, and generating an automatic test report containing data information of various temporary variables according to the execution result. And when the user inputs the case parameter information in the case parameter input interface, generating a case text of natural language description according to the case parameter information. Generating a test script according to each part of the text by carrying out text analysis on the case text; executing the test script and generating an automated test report containing the data information. Therefore, the case text of natural language description can be obtained, and the automatic test is performed based on the case text, so that the technical problem of poor readability of the existing automatic case is solved.
Description
Technical Field
The present application relates to the field of software testing technologies, and in particular, to an automatic testing method, apparatus, device, and storage medium.
Background
The software test is to run the system or application program under the preset condition, evaluate the running result, and the preset condition includes normal condition and abnormal condition. Automated testing is a process that converts human-driven testing behavior into machine execution. Typically, after the test cases are designed and passed through the review, the test is performed step by the tester according to the procedure described in the test cases, resulting in a comparison of the actual results with the expected results. In the process, in order to save manpower, time or hardware resources and improve the test efficiency, the concept of automatic test is introduced.
At present, the processing of a long transaction flow scene mainly uses a mode of manually calling interfaces or writing pytho n scripts to connect various interfaces in series to construct a service scene. The code writing time is long, repeated work is more, and efficiency is low. The automatic case has poor readability and high maintenance cost.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present application and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The application mainly aims to provide an automatic test method, an automatic test device, automatic test equipment and a storage medium, and aims to solve the technical problem that the readability of the existing automatic case is poor.
To achieve the above object, the present application provides an automated testing method, including:
acquiring case parameter information input by a user on a case parameter input interface;
generating a case text of natural language description according to the case parameter information;
performing text analysis on the case text, and generating a test script according to a text analysis result;
and executing the test script, and generating an automatic test report containing data information of various temporary variables according to an execution result.
Optionally, after the step of generating the case text of the natural language description according to the case parameter information, the method further includes:
step keywords and execution parameters of the case text are obtained;
and generating a case flow chart based on the step keywords and the execution parameters, and displaying the case flow chart to a user.
Optionally, the step of obtaining the step keyword and the execution parameter of the case text includes:
acquiring a preset regular expression;
and obtaining step keywords and execution parameters of the case text based on the regular expression and the case text.
Optionally, the step of generating a case flowchart based on the step keywords and the execution parameters and displaying the case flowchart to a user includes:
obtaining an execution parameter sequence based on the step keywords;
obtaining a case flow chart according to the execution parameter sequence and the execution parameters;
and after receiving a viewing instruction sent by the user, displaying the case flow chart to the user.
Optionally, the step of performing text parsing on the case text and generating a test script according to a text parsing result includes:
performing text analysis on the case text to obtain an analysis result;
carrying out batch processing on the analysis result to obtain a python sentence;
and generating a python test script according to the python statement.
Optionally, the step of generating the case text of the natural language description according to the case parameter information includes:
obtaining the execution sequence of the test steps, the test parameters and the test contents according to the case parameter information;
generating a case text segment based on the test parameters and the test content;
and combining the case text segments into the case text of the natural language description according to the execution sequence of the test steps.
Optionally, the step of acquiring the case parameter information input by the user at the case parameter input interface includes:
acquiring a form style selected by a user on a case parameter input interface;
and receiving case parameter information input by a user according to the selected form style.
In addition, to achieve the above object, the present application also proposes an automated testing apparatus including:
the parameter information acquisition module is used for acquiring case parameter information input by a user on the case parameter input interface;
the case text generation module is used for generating a case text of natural language description according to the case parameter information;
the case text analysis module is used for carrying out text analysis on the case text and generating a test script according to a text analysis result;
and the test script execution module is used for executing the test script and generating an automatic test report containing data information of various temporary variables according to an execution result.
In addition, to achieve the above object, the present application also proposes an automated test apparatus comprising: a memory, a processor, and an automated test program stored on the memory and executable on the processor, the automated test program configured to implement the steps of the automated test method as described above.
In addition, to achieve the above object, the present application also proposes a storage medium, wherein an automated test program is stored on the storage medium, the automated test program implementing the steps of the automated test method as described above when executed by a processor.
Acquiring case parameter information input by a user on a case parameter input interface; generating a case text of natural language description according to the case parameter information; performing text analysis on the case text, and generating a test script according to a text analysis result; and executing the test script, and generating an automatic test report containing data information of various temporary variables according to an execution result. And when the user inputs the case parameter information on the case parameter input interface, processing according to the case parameter information to generate a case text of natural language description. Generating a test script according to each part of the text by carrying out text analysis on the case text; and executing the test script, and generating an automatic test report containing data information of various temporary variables according to an execution result. Therefore, the case text of natural language description can be obtained, and the automatic test is carried out based on the case text, so that the technical problem of poor readability of the current automatic case is solved.
Drawings
FIG. 1 is a schematic diagram of an automated test equipment architecture for a hardware operating environment according to an embodiment of the present application;
FIG. 2 is a flow chart of a first embodiment of an automated testing method of the present application;
FIG. 3 is a flow chart of a second embodiment of the automated testing method of the present application;
fig. 4 is a schematic diagram of a case parameter entry interface for the automated test method of the present application;
FIG. 5 is a schematic illustration of a case flow diagram of an automated test method of the present application;
FIG. 6 is a block diagram of an automated test equipment according to the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an automated test equipment of a hardware running environment according to an embodiment of the present application.
As shown in fig. 1, the automated test equipment may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the configuration shown in FIG. 1 is not limiting of an automated test equipment and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and an automated test program may be included in the memory 1005 as one type of storage medium.
In the automated test equipment shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the automated test equipment of the present application may be disposed in the automated test equipment, and the automated test equipment invokes the automated test program stored in the memory 1005 through the processor 1001 and executes the automated test method provided by the embodiment of the present application.
An embodiment of the present application provides an automated testing method, and referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the automated testing method of the present application.
In this embodiment, the automated test method includes the following steps:
step S10: and acquiring case parameter information input by a user on a case parameter input interface.
It should be noted that the case parameter entry interface may be a page pushed to the user for receiving case parameter information.
It should be noted that, the case parameter information may refer to various parameters related to the test case, such as a transaction type, a transaction amount, a transaction date, etc., which are input by the user. The user may enter these parameter information through a case parameter entry interface.
In a specific implementation, for example, a user enters the following case parameter information at a case parameter entry interface: transaction type: purchasing; transaction amount: 100 yuan; transaction date: 2022, 1 month and 1 day. The automated test equipment receives the data and stores the data in a corresponding database.
Step S20: and generating a case text of the natural language description according to the case parameter information.
It is understood that the case text may be text described in natural language combined based on the case parameter information.
In a specific implementation, based on the case parameter information entered by the user, the system may automatically generate case text for the natural language description for subsequent text parsing and test script generation. For example, based on the case parameter information described above, the system may generate case text as described in natural language: a purchase transaction was made with a transaction amount of 100 yuan and a transaction date of 2022, 1 month and 1 day.
Step S30: and carrying out text analysis on the case text, and generating a test script according to a text analysis result.
It should be noted that the text parsing may be to analyze and interpret a piece of text data, and extract information, semantics and structure therein for further processing and application. This process typically includes the steps of word segmentation, part-of-speech tagging, named entity recognition, syntactic analysis, etc. of the text to obtain a higher level of linguistic information.
It is understood that the test script may refer to a series of instructions or code for performing a software test, comprising execution logic for the test case, input data, and expected output. The test script can be automatically executed to simulate the operation of a user and check whether the login function works normally. By writing a plurality of test scripts, different functions of the software can be comprehensively tested, and the quality and stability of the software are improved.
In a specific implementation, the case text is subjected to text analysis, and a test script is generated according to a text analysis result. The system performs text parsing on the natural language description case text, and converts the case text into executable test scripts.
Step S40: and executing the test script, and generating an automatic test report containing data information of various temporary variables according to an execution result.
It should be noted that the temporary variable may be data obtained during the test.
It can be understood that the automated test report may refer to a detailed test result report generated after the automated test is executed, including various indexes such as execution condition, success rate, failure rate, and test coverage rate of the test case. Automated test reports may help testers locate and fix problems quickly, and may also provide references to developers or other team members to improve software quality and development efficiency.
In a specific implementation, the test script is executed, and an automatic test report containing data information of various temporary variables is generated according to an execution result. And the system executes the generated test script and records the execution result. And according to the execution result, the system generates an automatic test report containing data information of various temporary variables.
The embodiment obtains the case parameter information input by the user on the case parameter input interface; generating a case text of natural language description according to the case parameter information; performing text analysis on the case text, and generating a test script according to a text analysis result; and executing the test script, and generating an automatic test report containing data information of various temporary variables according to an execution result. And when the user inputs the case parameter information on the case parameter input interface, processing according to the case parameter information to generate a case text of natural language description. Generating a test script according to each part of the text by carrying out text analysis on the case text; and executing the test script, and generating an automatic test report containing data information of various temporary variables according to an execution result. Therefore, the case text of natural language description can be obtained, and the automatic test is carried out based on the case text, so that the technical problem of poor readability of the current automatic case is solved.
Further, in order to facilitate the user understanding of the execution process of the case, in this embodiment, after step S20, the method further includes:
step S21: and acquiring step keywords and execution parameters of the case text.
It should be noted that the step keywords may be keywords or phrases used to describe the testing steps in the automated testing framework. Each step key represents a specific operation or verification action for constructing the execution flow of the test case. By using step keywords, test engineers can write test scripts in a higher level and more readable manner, improving maintainability and readability of test cases.
It is understood that the execution parameters may refer to input values or setting options that need to be provided when performing a particular task or operation. They can be used to control the behavior of the program, affecting the way the algorithm operates.
In a specific implementation, step keywords and execution parameters of the case text are acquired. The system analyzes the generated case text of the natural language description, and extracts step keywords and execution parameters.
Step S22: and generating a case flow chart based on the step keywords and the execution parameters, and displaying the case flow chart to a user.
It should be noted that, the case flowchart may be a graphical tool for describing the execution flow of the test case, and generally uses a form such as a flowchart or a state transition diagram. The method can help test engineers better understand the execution flow of the test case, identify possible problems and risks and optimize the design and execution of the test case.
In a specific implementation, a case flow chart is generated based on the step keywords and the execution parameters, and the case flow chart is presented to a user. And the system generates a corresponding case flow chart according to the extracted step keywords and the execution parameters, and displays the case flow chart to the user.
In the above manner of this embodiment, the step keywords and the execution parameters of the case text are obtained; and generating a case flow chart based on the step keywords and the execution parameters, and displaying the case flow chart to a user. And extracting step keywords and execution parameters, generating a case flow chart based on the step keywords and the execution parameters, and displaying the execution flow of the test case to a user. Thus, the user can intuitively know the execution process of the test case, and is convenient to understand and verify the correctness of the test.
Further, in order to accurately obtain the key information of the test case, in this embodiment, the step S21 includes:
s211: and acquiring a preset regular expression.
It is understood that the regular expression may be a tool for describing string patterns. It consists of a series of characters and special characters for matching and manipulating text data.
In a specific implementation, the system presets a set of regular expressions for matching step keywords and execution parameters in the case text.
S212: and obtaining step keywords and execution parameters of the case text based on the regular expression and the case text.
In a specific implementation, step keywords and execution parameters of the case text are obtained based on the regular expression and the case text. The system matches the generated case text according to a preset regular expression, and extracts step keywords and execution parameters in the case text.
In the above manner of the embodiment, a preset regular expression is obtained; and obtaining step keywords and execution parameters of the case text based on the regular expression and the case text. And matching the case text by using a preset regular expression, and extracting step keywords and execution parameters in the case text. Therefore, the key information of the test case can be accurately obtained, and the subsequent generation of the test script and the execution of the test are facilitated.
Further, in order to enable the user to intuitively understand the execution flow of the test case, in this embodiment, the step S22 includes:
step S221: and obtaining the execution parameter sequence based on the step keywords.
It should be noted that the execution parameter sequence may be a sequence obtained by sorting different execution parameters according to execution sequence.
In a specific implementation, the order of execution parameters is obtained based on the step keywords. And the system determines the sequence of the execution parameters according to the extracted step keywords.
Step S222: and obtaining a case flow chart according to the execution parameter sequence and the execution parameters.
In a specific implementation, a case flow diagram is obtained according to the execution parameter sequence and the execution parameters. The system generates a corresponding case flow chart according to the sequence of the execution parameters and the specific execution parameters.
Step S223: and after receiving a viewing instruction sent by the user, displaying the case flow chart to the user.
It is understood that the viewing instruction may be information of a surface viewing intention issued by a user through an operation.
In a specific implementation, after receiving a viewing instruction of a user, the system displays the generated case flow chart to the user.
The above manner of the present embodiment obtains the execution parameter order by the step key word; obtaining a case flow chart according to the execution parameter sequence and the execution parameters; and after receiving a viewing instruction sent by the user, displaying the case flow chart to the user. And obtaining an execution parameter sequence by utilizing the step keywords, and generating a case flow chart according to the execution parameter sequence and the specific execution parameters. And after receiving a viewing instruction of the user, displaying the case flow chart to the user. Therefore, the user can intuitively know the execution flow of the test case, and conveniently understand and verify the correctness of the test.
Based on the above embodiment, a second embodiment of the present application is presented. Referring to fig. 3, fig. 3 is a flow chart of a second embodiment of the automated testing method of the present application.
In this embodiment, the step S30 includes:
step S301: and carrying out text analysis on the case text to obtain an analysis result.
In particular implementations, the case text can be parsed using natural language processing techniques. First, the system would segment the case text and split the sentence into individual words. The system then labels the words for part of speech, and determines the part of speech of each word, e.g., nouns, verbs, adjectives, etc. The system then parses the sentence to analyze grammatical relations between words in the sentence, such as main-predicate relations, guest-move relations, etc. Finally, the system performs semantic analysis, and converts the analysis result into an executable analysis result according to the context and the semantic rule.
Step S302: and carrying out batch processing on the analysis result to obtain a python sentence.
In a specific implementation, corresponding processing can be performed according to the structure and the semantics of the analysis result. The system may extract the actions and parameters in the parsing result and assign them to the corresponding variables. The system may also perform a data type conversion, such as converting a string of money into a value type. Eventually, the system will generate a series of Python statements for performing the test steps.
Step S303: and generating a python test script according to the python statement.
In a specific implementation, the generated Python sentences are organized according to a certain format to form a complete Python test script. A test case function is defined in the script, and the function comprises codes for executing test steps according to the analysis result. Finally, the system calls the test case function at the end of the script to perform the test.
The above manner of the embodiment obtains the analysis result by performing text analysis on the case text; carrying out batch processing on the analysis result to obtain a python sentence; and generating a python test script according to the python statement. And carrying out text analysis on the case text to obtain an analysis result, carrying out batch processing to generate Python sentences, and finally generating Python test scripts according to the Python sentences. Therefore, the case text of the natural language description can be converted into the executable test script, and the automatic test is convenient.
Further, in order to obtain more accurate case text, step S20 includes:
step S201: and obtaining the execution sequence of the test steps, the test parameters and the test contents according to the case parameter information.
In a specific implementation, the execution sequence of the test steps is determined according to the case parameter information input by the user. The execution order may be determined based on the logical relationships, dependencies, etc. of the cases. At the same time, the system will extract the test parameters and test content related to the case parameters for subsequent generation of the case text segment.
Step S202: and generating a case text segment based on the test parameters and the test content.
In a specific implementation, the extracted test parameters and test contents are converted into a case text segment of natural language description. The system can adopt a fixed text template or dynamically generate text segments according to the characteristics and the requirements of the cases. The text segment should be able to accurately describe the test steps and related parameter information.
Step S203: and combining the case text segments into the case text of the natural language description according to the execution sequence of the test steps.
In a specific implementation, according to the execution sequence of the test steps, the generated case text segments are sequentially combined to form the case text of the natural language description. The combination mode can be simple connection or can be organized according to the logic relation of the cases.
According to the embodiment, the execution sequence, the test parameters and the test contents of the test steps are obtained according to the case parameter information; generating a case text segment based on the test parameters and the test content; and combining the case text segments into the case text of the natural language description according to the execution sequence of the test steps. Determining the execution sequence of the test steps according to the case parameter information, extracting the test parameters and the test contents, generating corresponding case text segments, and combining the text segments into a case text described by natural language according to the execution sequence. Therefore, the test case text corresponding to the parameter information can be generated according to the parameter information input by the user, subsequent text analysis and test script generation are facilitated, and more accurate case text can be obtained.
Further, in order to ensure the accuracy and consistency of the input, step S10 includes:
step S101: and acquiring a form style selected by a user on the case parameter input interface.
It is to be appreciated that the form styles can be preset styles of case parameter entry interfaces for user selection.
In a specific implementation, the style provides the user with multiple form styles for selection according to the designed interface layout and style. Form styles may include text boxes, drop down lists, radio buttons, check boxes, and the like. The user may select the appropriate form style as desired.
Step S102: and receiving case parameter information input by a user according to the selected form style.
In a specific implementation, corresponding input controls, such as text boxes, drop-down lists, radio buttons, check boxes, and the like, are generated according to the form style selected by the user. The user can enter relevant case parameter information through these controls. The system receives information input by a user in real time, and stores and processes the information.
The embodiment obtains the form style selected by the user on the case parameter input interface; and receiving case parameter information input by a user according to the selected form style. And receiving information input by the user according to the form style selected by the user so as to process and generate the case text of the natural language description later. In this way, the user can conveniently input relevant case parameter information and ensure the accuracy and consistency of the input.
Based on the above embodiment, a third embodiment of the present application is presented, in this embodiment, when a user writes an automated test case through the present application, a case text of a natural language description is generated through simple step checkout and parameter filling. Referring to fig. 4, fig. 4 is a schematic diagram of a case parameter entry interface for an automated test method of the present application. For example, the web interface has a number of preset steps, which can be selected to be dried in the first step and to be dried in the second step, and parameters required by the steps can be recorded during the selection. After the computer obtains the instructions, the steps and parameters of the response are recorded, and the case text is spliced according to a certain programming language format. The text contains the execution sequence of the test steps, the test parameters, the test contents and other information.
And then, the front-end page acquires the case step keywords and the execution parameters through the regular expression. And the computer reads the key information by using the regular expression according to the generated text, and generates a flow chart on the webpage by using JavaScript. And the case flow chart is generated after the analysis of the case text is completed, so that a user can understand the case execution process conveniently. Referring to fig. 5, fig. 5 is a schematic diagram of a case flow diagram of an automated test method of the present application. As shown in the figure, the sequence of different steps is obtained according to the step keywords, and the specific sequence is cutting date, paying money, opening an account for an internal account, cutting date, manually settling information, verifying results, deleting single-day transactions and verifying results. Specific execution parameters are displayed in each step.
And the back end generates a python test script through analyzing the text, performs automatic execution of the case and generates a test report. Specifically, in the case execution process, various execution information (such as success, failure, time and log records) of the case are stored, and after the execution is completed, the state information in the execution process is read. And generating an html file by the computer according to the preset template, namely, a test report. The test report contains data information of various temporary variables, so that test staff can conveniently check the problems.
In addition, in order to achieve the above object, the present application further provides an automated testing apparatus, referring to fig. 6, fig. 6 is a block diagram of the automated testing apparatus of the present application, the automated testing apparatus includes:
the parameter information acquisition module is used for acquiring case parameter information input by a user on the case parameter input interface;
the case text generation module is used for generating a case text of natural language description according to the case parameter information;
the case text analysis module is used for carrying out text analysis on the case text and generating a test script according to a text analysis result;
and the test script execution module is used for executing the test script and generating an automatic test report containing data information of various temporary variables according to an execution result.
The embodiment obtains the case parameter information input by the user on the case parameter input interface; generating a case text of natural language description according to the case parameter information; performing text analysis on the case text, and generating a test script according to a text analysis result; and executing the test script, and generating an automatic test report containing data information of various temporary variables according to an execution result. And when the user inputs the case parameter information on the case parameter input interface, processing according to the case parameter information to generate a case text of natural language description. Generating a test script according to each part of the text by carrying out text analysis on the case text; and executing the test script, and generating an automatic test report containing data information of various temporary variables according to an execution result. Therefore, the case text of natural language description can be obtained, and the automatic test is carried out based on the case text, so that the technical problem of poor readability of the current automatic case is solved.
In addition, to achieve the above object, the present application also proposes a storage medium having stored thereon an automated test program which, when executed by a processor, implements the steps of the automated test method as described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (10)
1. An automated test method, the automated test method comprising:
acquiring case parameter information input by a user on a case parameter input interface;
generating a case text of natural language description according to the case parameter information;
performing text analysis on the case text, and generating a test script according to a text analysis result;
and executing the test script, and generating an automatic test report containing data information of various temporary variables according to an execution result.
2. The automated testing method of claim 1, wherein after the step of generating the case text of the natural language description from the case parameter information, further comprising:
step keywords and execution parameters of the case text are obtained;
and generating a case flow chart based on the step keywords and the execution parameters, and displaying the case flow chart to a user.
3. The automated testing method of claim 2, wherein the step of obtaining step keywords and execution parameters of the case text comprises:
acquiring a preset regular expression;
and obtaining step keywords and execution parameters of the case text based on the regular expression and the case text.
4. The automated testing method of claim 2, wherein the generating a case flow chart based on the step key and the execution parameters and presenting the user with the step of the case flow chart comprises:
obtaining an execution parameter sequence based on the step keywords;
obtaining a case flow chart according to the execution parameter sequence and the execution parameters;
and after receiving a viewing instruction sent by the user, displaying the case flow chart to the user.
5. The automated testing method of claim 1, wherein the step of text parsing the case text and generating the test script based on the text parsing result comprises:
performing text analysis on the case text to obtain an analysis result;
carrying out batch processing on the analysis result to obtain a python sentence;
and generating a python test script according to the python statement.
6. The automated testing method of any of claims 1-5, wherein the step of generating the case text of a natural language description from the case parameter information comprises:
obtaining the execution sequence of the test steps, the test parameters and the test contents according to the case parameter information;
generating a case text segment based on the test parameters and the test content;
and combining the case text segments into the case text of the natural language description according to the execution sequence of the test steps.
7. The automated testing method of any of claims 1-5, wherein the step of obtaining case parameter information entered by a user at a case parameter entry interface comprises:
acquiring a form style selected by a user on a case parameter input interface;
and receiving case parameter information input by a user according to the selected form style.
8. An automated test apparatus, the automated test apparatus comprising:
the parameter information acquisition module is used for acquiring case parameter information input by a user on the case parameter input interface;
the case text generation module is used for generating a case text of natural language description according to the case parameter information;
the case text analysis module is used for carrying out text analysis on the case text and generating a test script according to a text analysis result;
and the test script execution module is used for executing the test script and generating an automatic test report containing data information of various temporary variables according to an execution result.
9. An automated test equipment, the equipment comprising: a memory, a processor and an automated test program stored on the memory and executable on the processor, the automated test program configured to implement the steps of the automated test method of any of claims 1 to 7.
10. A storage medium having stored thereon an automated test program which, when executed by a processor, implements the steps of the automated test method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310990167.6A CN117076297A (en) | 2023-08-07 | 2023-08-07 | Automatic test method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310990167.6A CN117076297A (en) | 2023-08-07 | 2023-08-07 | Automatic test method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117076297A true CN117076297A (en) | 2023-11-17 |
Family
ID=88718652
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310990167.6A Pending CN117076297A (en) | 2023-08-07 | 2023-08-07 | Automatic test method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117076297A (en) |
-
2023
- 2023-08-07 CN CN202310990167.6A patent/CN117076297A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10830817B2 (en) | Touchless testing platform | |
US10642721B2 (en) | Generation of automated testing scripts by converting manual test cases | |
US10108535B2 (en) | Web application test script generation to test software functionality | |
Fantechi et al. | Applications of linguistic techniques for use case analysis | |
CN106598869A (en) | Method and device for realizing automatic software testing and electronic equipment | |
US20070061641A1 (en) | Apparatus and method for generating test driver | |
CN114048129A (en) | Automatic testing method, device, equipment and system for software function change | |
CN105573980A (en) | Information segment generation method and device | |
CN109710523B (en) | Visual draft test case generation method and device, storage medium and electronic equipment | |
CN113064811B (en) | Automatic testing method and device based on workflow and electronic equipment | |
CN117312148A (en) | Automatic interface testing method and device, computer equipment and storage medium | |
CN117076297A (en) | Automatic test method, device, equipment and storage medium | |
CN115964269A (en) | Test processing method and device, electronic equipment and storage medium | |
CN113051262A (en) | Data quality inspection method, device, equipment and storage medium | |
CN112631930B (en) | Dynamic system testing method and related device | |
CN110928535A (en) | Derivative variable deployment method, device, equipment and readable storage medium | |
CN116909533B (en) | Method and device for editing computer program statement, storage medium and electronic equipment | |
Cuadrado et al. | Integrating Static Quality Assurance in CI Chatbot Development Workflows | |
CN117472744A (en) | Page element positioning method, electronic device and storage medium | |
CN116993510A (en) | Natural language-based financial product online method, device, equipment and medium | |
CN112631930A (en) | Dynamic system testing method and related device | |
CN118260191A (en) | Rule engine testing method, device, equipment and medium | |
PINA | Auto test generator: a framework to generate test cases from requirements in natural language | |
CN117971953A (en) | Data analysis result visualization method, device, equipment and storage medium | |
CN117909234A (en) | Mobile terminal automatic test method and system based on natural language recognition |
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 |