CN111459796B - Automated testing method, apparatus, computer device and storage medium - Google Patents

Automated testing method, apparatus, computer device and storage medium Download PDF

Info

Publication number
CN111459796B
CN111459796B CN202010123717.0A CN202010123717A CN111459796B CN 111459796 B CN111459796 B CN 111459796B CN 202010123717 A CN202010123717 A CN 202010123717A CN 111459796 B CN111459796 B CN 111459796B
Authority
CN
China
Prior art keywords
function
test
configuration information
template
tested
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.)
Active
Application number
CN202010123717.0A
Other languages
Chinese (zh)
Other versions
CN111459796A (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.)
Xian Fibocom Wireless Software Inc
Original Assignee
Xian Fibocom Wireless Software Inc
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 Xian Fibocom Wireless Software Inc filed Critical Xian Fibocom Wireless Software Inc
Priority to CN202010123717.0A priority Critical patent/CN111459796B/en
Publication of CN111459796A publication Critical patent/CN111459796A/en
Application granted granted Critical
Publication of CN111459796B publication Critical patent/CN111459796B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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
    • 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/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to an automated testing method, an automated testing device, computer equipment and a storage medium. The method comprises the following steps: acquiring configuration information; the configuration information comprises a test sequence of each functional point to be tested, a function template identifier and input parameters corresponding to each function template identifier; extracting a function template corresponding to the function template identification from a preset function template set; filling the input parameters into corresponding function templates to obtain execution scripts corresponding to each input parameter; executing each execution script according to the test sequence to obtain a test result of each functional point to be tested. By adopting the method, the efficiency of automatic test can be improved.

Description

Automated testing method, apparatus, computer device and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an automated testing method, an automated testing device, a computer device, and a storage medium.
Background
Automated testing refers to a process that converts human-driven testing behavior into machine execution. Generally, after a test case is designed and passed through review, a tester correspondingly converts information such as a test target, a test environment, input data, a test step and the like described in the test case into a script file, and a computer can obtain a test result by executing the script file. At present, script files are mainly generated by using automated testing tools such as Selenium, quickTest Professional software and the like.
However, input parameters and execution sequence of each functional point to be tested in the script file written and obtained based on the automatic test tools such as the Selenium, quickTest Professional software and the like are fixed, and when the execution sequence and the input parameters need to be adjusted, the script file is greatly modified, so that the efficiency of the automatic test is reduced.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an automated testing method, apparatus, computer device, and storage medium that can improve the efficiency of automated testing.
An automated testing method, the method comprising:
acquiring configuration information; the configuration information comprises a test sequence of each functional point to be tested, a function template identifier and input parameters corresponding to each function template identifier;
extracting a function template corresponding to the function template identification from a preset function template set;
filling the input parameters into corresponding function templates to obtain execution scripts corresponding to each input parameter;
and executing each execution script according to the test sequence to obtain a test result of each functional point to be tested.
In one embodiment, the method further comprises:
Displaying a task configuration page of an automatic test task;
determining function template identifiers configured for all function points to be tested in the task configuration page;
when the function template identification is subjected to sorting operation, displaying the sorted function template identification in the task configuration page;
and generating configuration information according to the ordered function template identifiers.
In one embodiment, the task configuration page for displaying an automated test task includes:
acquiring a plurality of pieces of historical task configuration information;
screening target task configuration information from the plurality of pieces of historical task configuration information according to a selection instruction of the plurality of pieces of historical task configuration information;
and displaying the target task configuration information in a task configuration page.
In one embodiment, the method further comprises:
displaying a task configuration page of an automatic test task;
determining input information configured for the functional points to be tested in the task configuration page; the input information comprises parameter types, value ranges and input quantity;
generating a plurality of normal values and abnormal values corresponding to the parameter types according to the value range;
And corresponding configuration information based on the normal value and the abnormal value.
In one embodiment, the function points to be tested are in one-to-one correspondence with the function templates; and correspondingly filling the input parameters into the function templates, wherein the step of obtaining the execution script comprises the following steps:
acquiring the input quantity of input parameters corresponding to each function template;
copying the function template based on the input quantity to obtain a copy template;
and correspondingly filling each input parameter into a copy template to obtain a plurality of execution scripts.
In one embodiment, executing each execution script according to the test sequence, and obtaining the test result of each functional point to be tested includes:
sorting the function point identifiers of the function points to be tested according to the test sequence to obtain an identifier sequence;
determining one or more execution scripts corresponding to the current function point identification;
sequentially running the execution scripts to obtain a test result of the functional point to be tested;
and taking the function point identifiers which are adjacent to the current function point identifier and are positioned in the next sequence in the identifier sequence as the current function point identifier, and returning to the step of determining the execution script corresponding to the current function point until all the function point identifiers in the identifier sequence are traversed.
In one embodiment, the method further comprises:
acquiring a test log and a script identification corresponding to the execution script;
according to the script identification, the test log and the corresponding test result are associated to obtain an association list;
and generating a test result display page according to the association list, and correspondingly displaying the test result display page.
An automated testing apparatus, the apparatus comprising:
the configuration information acquisition module is used for acquiring configuration information; the configuration information comprises a test sequence of each functional point to be tested, a function template identifier and input parameters corresponding to each function template identifier;
the execution script acquisition module is used for extracting a function template corresponding to the function template identifier from a preset function template set; filling the input parameters into corresponding function templates to obtain execution scripts corresponding to each input parameter;
and the test result acquisition module is used for executing each execution script according to the test sequence to obtain the test result of each functional point to be tested.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of:
Acquiring configuration information; the configuration information comprises a test sequence of each functional point to be tested, a function template identifier and input parameters corresponding to each function template identifier;
extracting a function template corresponding to the function template identification from a preset function template set;
filling the input parameters into corresponding function templates to obtain execution scripts corresponding to each input parameter;
and executing each execution script according to the test sequence to obtain a test result of each functional point to be tested.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring configuration information; the configuration information comprises a test sequence of each functional point to be tested, a function template identifier and input parameters corresponding to each function template identifier;
extracting a function template corresponding to the function template identification from a preset function template set;
filling the input parameters into corresponding function templates to obtain execution scripts corresponding to each input parameter;
and executing each execution script according to the test sequence to obtain a test result of each functional point to be tested.
According to the automatic testing method, the automatic testing device, the computer equipment and the storage medium, the testing sequence of each functional point to be tested, the function template identification and the input parameters corresponding to each function template identification can be determined based on the configuration information by acquiring the configuration information; extracting a function template corresponding to the function template identifier from the function template set, and filling input parameters into the corresponding function template to obtain an execution script; by executing each execution script in the test sequence, the test result of each functional point to be tested can be obtained, and thus, the automatic test can be realized. Because the configuration information is extracted from the execution script, compared with the traditional method of writing the execution sequence and the input parameters into a specific function main body, the scheme can effectively reduce redundancy of codes, and when the test sequence and the input parameters are required to be adjusted, the configuration information is only required to be adaptively modified, and the test codes are not required to be greatly adjusted, so that the efficiency of automatic test is improved.
Drawings
FIG. 1 is an application scenario diagram of an automated test method in one embodiment;
FIG. 2 is a flow diagram of an automated test method in one embodiment;
FIG. 3 is a flow chart illustrating a configuration information acquisition step in one embodiment;
FIG. 4 is a block diagram of an automated test equipment in one embodiment;
FIG. 5 is a block diagram of an automated test equipment in another embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The automatic test method provided by the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers. The terminal 102 generates configuration information according to the operation of the tester, and transmits the configuration information to the server 104. The server 104 obtains the function templates, analyzes the received configuration information to obtain the test sequence and input parameters of each function point to be tested, and fills the function templates based on the input parameters to obtain the execution script. The server 104 runs the execution script based on the test sequence to obtain a test result.
In one embodiment, as shown in fig. 2, an automated testing method is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
s202, acquiring configuration information.
The configuration information refers to test conditions configured for each functional point to be tested. The configuration information comprises a test sequence of each function point to be tested, a function template identifier and input parameters corresponding to each function template identifier. The test function points refer to test points set by specific business processes which can be completed independently in the software to be tested, for example, the login function and the registration function in the software to be tested are two function points, and the test points set by the two function points are called as the function points to be tested. The function template refers to a test function which replaces specific input parameters by form parameters and is written based on the form parameters. The formal parameters, also called virtual parameters, are parameters used when defining the names and volumes of functions in a test function, and are intended to receive specific parameters that are entered when the function is called.
Specifically, the terminal acquires configuration information configured by a tester for each functional point to be tested, stores the configuration information in a configuration file in the form of key value pairs, and then sends the configuration file to the server. For example, the configuration information configured for the login function may be "function template identification: logging template "," input parameters: a ", the configuration information configured for the registration function may be" function template identification: registration template "," input parameters: and B, the terminal acquires the test sequence between the login function and the registration function, and stores the test sequence, the configuration information configured for the login function and the configuration information configured for the registration function into a configuration file.
The server receives the configuration file and reads configuration information in the configuration file according to preset keywords, so that the test sequence of each function point to be tested, the function template identification corresponding to the function point to be tested and the input parameters are obtained. The server analyzes the function template identification and the input parameters associated with the function points to be detected to obtain the input parameters corresponding to the function template identification.
In another embodiment, when the terminal determines that the tester finishes configuring the current function point to be tested, the terminal sends the configuration information of the current function point to be tested to the server in real time, and the server caches the configuration information.
In another embodiment, the terminal acquires a function template written for the function point to be tested, generates a corresponding regular matching expression based on position information of a function name of a test function in the function template and a writing format, performs regular matching on each row of codes in the function template based on the generated regular matching expression, so as to obtain a function name, takes the function name as a function template identifier, generates corresponding configuration information based on the function template identifier, and then sends the configuration information to the server.
S204, extracting the function template corresponding to the function template identification from the preset function template set.
The function template set refers to a set in which function templates written by a tester according to each function point in the software to be tested are stored. The function template identification refers to information capable of uniquely identifying a function template, and when the function template is written, a tester can set a template identification for each written function template, and correspondingly store the template identification and the function template into a function template set.
Specifically, when the server extracts one or more function template identifiers from the configuration information, the server compares each function template identifier with the function template identifiers in the function template set, and when the same function template identifier is found in the function template set, the server extracts the function template from the function template set and stores the extracted function template in a temporary storage space. The server compares the function template identifiers extracted from the configuration information with the function template identifiers in the function template set in sequence until the function template identifiers extracted from the configuration information are traversed.
In another embodiment, when the server extracts a plurality of function template identifiers from the configuration information, the server compares the extracted plurality of function template identifiers with function template identifiers in the function template set at the same time, so that a function template corresponding to the function template identifiers is extracted at one time.
S206, filling the input parameters into the corresponding function templates to obtain the execution script corresponding to each input parameter.
Specifically, the server determines input parameters corresponding to each function template, determines position information to be filled in the corresponding function templates according to key values in the input parameters, and fills the input parameters into the function templates according to the position information to be filled. For example, when the function point to be detected is a search function in a search page, the corresponding input parameter is "search word: and when the key value information in the input parameters is determined to be the search word by the server, the server queries the position information of the search word from the function template according to the key value information search word, and correspondingly fills the A according to the position information. And the server sequentially traverses the input parameters corresponding to each template until the input parameters are correspondingly filled into each function template.
In another embodiment, the server obtains the function name of the test function in the function template, judges whether the function name carries the form parameters, if so, determines the corresponding received input parameters according to the parameter types of the form parameters, and receives the input parameters based on the form parameters, thereby obtaining the execution script. For example, when the test function is an addition function, the corresponding function name and the formal output parameter are "add (int a, float b)", and at this time, the server determines that the formal parameter is shaping and floating point, and receives the corresponding input parameter according to the parameter type of the formal parameter, to obtain the execution script. The execution script refers to a file that the computer can directly run.
And S208, executing each execution script according to the test sequence to obtain a test result of each functional point to be tested.
Specifically, the server acquires script identifications of each execution script, and sequences the script identifications according to the test sequence of each functional point to be tested to obtain an identification sequence. And the server sequentially runs the execution script based on the identification sequence to obtain a test result of each functional point to be tested.
In another embodiment, the configuration information further includes configuring preconditions for the function templates. When the server runs the execution script, the server judges whether the preconditions corresponding to the function templates exist in the configuration information, and if the preconditions exist, the server runs the corresponding execution script based on the preconditions. The precondition refers to some information necessary for running the function body in the execution script, for example, the precondition may be a reference path of some library functions in the function body, and the like.
In another embodiment, the server may sort the function template identifiers according to the test sequence of each function point to be tested, to obtain a function template identifier sequence. The server determines the function template to be filled currently based on the function template identification sequence, and fills the input parameters into the function template to be filled currently to obtain the script to be executed currently. The server executes the current script to be executed to obtain a test result, and the function templates which are adjacent to the function templates to be filled currently in the function template identification sequence and are positioned in the next sequence are used as the function templates to be filled currently, and then the step of filling the input parameters into the function templates to be filled currently is returned to obtain the script to be executed currently until the function template identification sequence is traversed.
In the automatic test method, by acquiring the configuration information, the test sequence of each function point to be tested, the function template identification and the input parameters corresponding to each function template identification can be determined based on the configuration information; extracting a function template corresponding to the function template identifier from the function template set, and filling input parameters into the corresponding function template to obtain an execution script; by executing each execution script in the test sequence, the test result of each functional point to be tested can be obtained, and thus, the automatic test can be realized. Because the configuration information is extracted from the execution script, compared with the traditional method of writing the execution sequence and the input parameters into a specific function main body, the scheme can effectively reduce redundancy of codes, and when the test sequence and the input parameters are required to be adjusted, the configuration information is only required to be adaptively modified, and the test codes are not required to be greatly adjusted, so that the efficiency of automatic test is improved.
In another embodiment, as shown in fig. 3, the above automated test method further includes:
s302, a task configuration page of an automatic test task is displayed;
s304, determining function template identifiers configured for all function points to be tested in the task configuration page;
s306, when sorting operation of the function template identifiers occurs, displaying the sorted function template identifiers in a task configuration page;
s308, generating configuration information according to the ordered function template identifiers.
Specifically, the task configuration page can be displayed on the terminal through a web application, and when the functional points to be tested need to be configured, a tester opens the task configuration page through a plurality of modes such as inputting a preset website, clicking an application identifier of an automatic test application and the like. The task configuration page includes an operation area and a selection area. The selection area is provided with a control icon corresponding to the function point to be detected and a control icon corresponding to the function template identifier. The tester can drag the plurality of control icons in the selection area to the operation area in a dragging mode, so that the subsequent tester can correspondingly configure the control icons in the operation area.
Further, the testers pair the function template identification and the function points to be tested in the operation area in a clicking and dragging mode. The terminal performs condition verification on each function point to be tested and the function template identification according to the operation of the tester, and after the verification is successful, the terminal determines the function template identification as identification information configured for the corresponding function point to be tested.
Further, the tester can perform sorting operation on the function template identifiers in the operation area, the terminal monitors clicking operation of the tester, after clicking the control with the meaning of 'completion' is confirmed, the tester can be considered to finish the sorting operation on the function template identifiers, at the moment, the terminal correspondingly displays a final sorting result, and configuration information is generated according to the sorting result.
In this embodiment, by displaying a task configuration page for automated testing, a configuration process of an abstract functional point to be tested may be visualized; through simple drag and click operations, function template identifiers corresponding to function points to be detected and ordering information among the function template identifiers can be determined, so that configuration information can be generated according to the ordered function template identifiers. Based on a visual task configuration page, a tester can realize a complex automatic test process by only carrying out simple configuration operation, so that even common business personnel without programming can carry out complete configuration operation, and the threshold of automatic test is reduced.
In another embodiment, a task configuration page that exposes automated test tasks includes: acquiring a plurality of pieces of historical task configuration information; screening target task configuration information from the plurality of pieces of historical task configuration information according to a selection instruction of the plurality of pieces of historical task configuration information; and displaying the target task configuration information in the task configuration page.
The task configuration information is information configured by a tester for an automatic test task in a task configuration page. For example, when the automated test task is "test software a", the user may determine the functional point to be tested of the software a in the task configuration page, the function template identifier corresponding to the functional point to be tested, and the ranking information between the function template identifiers. At this time, the function points to be tested, the function template identifiers corresponding to the function points to be tested and the ordering information among the function template identifiers are collectively called as task configuration information.
Specifically, when a tester opens a task configuration page, the terminal extracts historical task configuration information of a historical automatic test task from the cache, and displays the historical task configuration information on the task configuration page in a list mode. When the automatic test task needs to be repeatedly executed, a user can select corresponding historical task configuration information in the list, and then the terminal displays the corresponding historical task configuration information on a task configuration page according to the selection operation of a tester.
In another embodiment, the tester modifies the displayed historical task configuration information, so that the terminal can acquire the modification information, obtain final target task configuration information based on the modification information, and then send the target task configuration information to the server.
In another embodiment, the tester may select a plurality of pieces of historical task configuration information, so that the terminal may simultaneously transmit the plurality of pieces of historical task configuration information to the server, and the server correspondingly performs the automated test task based on the plurality of pieces of historical task configuration information at the same time.
In this embodiment, by visually displaying a plurality of pieces of historical task configuration information, when an automatic test task needs to be repeatedly executed, corresponding configuration information can be quickly determined based on the historical task configuration information, so that the configuration operation on the function points or function templates to be tested does not need to be repeated again, and the workload of a tester is greatly reduced.
In another embodiment, the automated testing method further comprises: displaying a task configuration page of an automatic test task; determining input information configured for the functional points to be tested in the task configuration page; the input information comprises parameter types, value ranges and input quantity; generating a plurality of normal values and abnormal values corresponding to the parameter types according to the value range; corresponding configuration information is based on the normal value and the abnormal value.
Specifically, when the tester drags the control icon of the functional point to be tested to the operation area, the tester can configure input parameters for the functional point to be tested in a clicking manner. More specifically, the terminal monitors clicking operation of the tester, and when clicking operation of the tester on the functional point to be tested is captured, the terminal correspondingly pops up the input data configuration page. The input data configuration page is a page comprising a parameter type input box, a value range input box and an input number input box.
And configuring the input parameters of the function points to be tested in the input data configuration page by the tester according to specific actual requirements. And then, the terminal generates a corresponding number of normal values and abnormal values according to the parameter type, the value range and the input number of the input parameters, and sends the generated normal values and abnormal values to the server. For example, when the input parameter type is set to be positive shaping, the value range is 0 (not included) to 100 (included), and the number is 20, the terminal randomly generates 20 normal values and abnormal values. The normal value can be a value of which the input parameter is positive shaped and the value range is 0 (not included) to 100 (included); the abnormal value input parameter is not being shaped or the value range is not 0 (not included) to 100 (included).
In another embodiment, when the function body in the function template has a plurality of form parameters, a plurality of sets of input information can be configured for one function point to be tested, so that the function template can normally operate based on the plurality of sets of input information. For example, when testing a login function, a set of user names and a set of passwords may be configured for the login test point, and a function template corresponding to the login test point performs the login function point test based on the user names and the passwords.
In this embodiment, by configuring the input parameters in the task configuration page, the terminal may automatically generate a corresponding number of normal values and abnormal values based on the configuration information, so that the workload of the tester may be greatly reduced, and further the efficiency of the automated test may be improved.
In another embodiment, the configuration information further includes an input number of input parameters; correspondingly filling the input parameters into the function templates, and obtaining the execution script comprises the following steps: acquiring the input quantity of input parameters corresponding to each function template; copying the function template based on the input quantity to obtain a copy template; and correspondingly filling each input parameter into a copy template to obtain a plurality of execution scripts.
Specifically, the server acquires input information corresponding to each function template, and extracts the input number of the input parameters from the input information. And the server copies the corresponding function templates according to the input quantity to obtain a plurality of copy templates. For example, when the number of input parameters corresponding to the function template a is a and the number of input parameters corresponding to the function template B is B, the server replicates the function template a to obtain a replicated templates; and the server replicates the function template B to obtain B replicated templates. And the server fills the input parameters in the configuration information into the associated copy templates correspondingly to obtain a plurality of execution scripts.
In another embodiment, when the input information corresponding to the function template has a plurality of sets, the server obtains the number of inputs in one of the sets of input information and copies the function template based on the number of inputs. The server extracts one input parameter in a plurality of groups of input information respectively, and fills the input parameter into a function template to obtain an execution script.
In the embodiment, all execution scripts can be obtained quickly by copying and parameter filling through the function template, so that the subsequent server can directly run the execution scripts, and further the efficiency of automatic test is improved.
In another embodiment, there are a plurality of execution scripts corresponding to the function points to be tested; executing each execution script according to the test sequence, and obtaining the test result of each functional point to be tested comprises the following steps: sorting the function point identifiers of the function points to be tested according to the test sequence to obtain an identifier sequence; determining one or more execution scripts corresponding to the current function point identification; sequentially running execution scripts to obtain a test result of the functional point to be tested; and taking the function point identifiers which are adjacent to the current function point identifier and are positioned in the next sequence in the identifier sequence as the current function point identifier, and returning to the step of determining the execution script corresponding to the current function point until all the function point identifiers in the identifier sequence are traversed.
Specifically, the server acquires the function point identifiers of each function point to be tested, and sorts the function point identifiers to be tested according to the test sequence to obtain an identification sequence, wherein the head part of the identification sequence is the function point to be tested which is required to be tested first, and the tail part of the identification sequence is the function point to be tested which is required to be tested last. The server extracts the function point identifier positioned at the head from the identifier sequence, and takes the extracted function point identifier as the current function point identifier. The server determines a function template corresponding to the current function point identifier, acquires an execution script corresponding to the function template, and then sequentially runs the execution script to obtain a test result. The server takes the function point identifiers adjacent to the current function point identifiers in the identifier sequence and positioned in the next sequence as new current function point identifiers, and returns to the step of determining the execution script corresponding to the current function point until all the function point identifiers in the identifier sequence are traversed.
In another real-time example, after the server determines the execution script corresponding to the current function point, the server runs one of the execution scripts and correspondingly caches the execution result, and at the same time, the server correspondingly deletes the executed execution script. The server takes the function point identifiers adjacent to the current function point identifiers in the identification sequence and positioned in the next sequence as new current function point identifiers, returns to running one of the execution scripts, and correspondingly caches the execution results until all the function point identifiers in the identification sequence are traversed. The server judges whether an execution script corresponding to the function point identification exists in the cache, if so, the server extracts the function point identification from the identification sequence according to the execution sequence, and executes the execution script corresponding to the function point identification based on the method until the execution script does not exist in the cache.
In this embodiment, the execution script is correspondingly executed according to the test sequence, so that different test results can be obtained based on different test sequences, and the test range of the automatic test can be further improved.
In another embodiment, the automated testing method further comprises: acquiring a test log and a script identification corresponding to an execution script; according to the script identification, the test log and the corresponding test result are associated to obtain an association list; and generating a test result display page according to the association list, and correspondingly displaying the test result display page.
The test log is generated in the execution process of the test case. The test log is the basis of test process monitoring, test results and software quality evaluation, and is also an important basis for data analysis and process improvement.
Specifically, each execution script generates a test log during the running process. The server can acquire script identifications and test logs corresponding to each execution script, and then correlate the corresponding test logs with test results according to the script identifications of each execution script to obtain a correlation list, the correlation list is sent to the terminal, the terminal generates a test result display page based on the correlation list, and the test result display page is correspondingly displayed.
In another embodiment, the server may further obtain all the script identifiers, and associate the script identifiers with the corresponding test logs and test results respectively, and then analyze the associated test results to obtain a comprehensive test result of the software to be tested. For example, the test device may obtain all test results of the software a to be tested from the association list, and count all test results to obtain a comprehensive test result of the software a to be tested.
In the above embodiment, the test results are associated with the corresponding test logs and displayed, so that the test results of the automated test task can be visually displayed in a visual manner.
It should be understood that, although the steps in the flowcharts of fig. 2-3 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-3 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or steps.
In one embodiment, as shown in FIG. 4, an automated test equipment 400 is provided, comprising: a configuration information acquisition module 402, an execution script acquisition module 404, and a test result acquisition module 406, wherein:
a configuration information acquisition module 402, configured to acquire configuration information; the configuration information comprises a test sequence of each functional point to be tested, a function template identifier and input parameters corresponding to each function template identifier;
an execution script acquisition module 404, configured to extract a function template corresponding to the function template identifier from a preset function template set; filling the input parameters into corresponding function templates to obtain execution scripts corresponding to each input parameter;
and the test result obtaining module 406 is configured to execute each execution script according to the test sequence, so as to obtain a test result of each functional point to be tested.
In another embodiment, as shown in fig. 5, the automatic test apparatus 400 further includes a configuration information generating module 408, configured to display a task configuration page of the automatic test task; determining function template identifiers configured for all function points to be tested in a task configuration page; when the function template identification is subjected to sorting operation, displaying the sorted function template identification in a task configuration page; and generating configuration information according to the ordered function template identifiers.
In another embodiment, the configuration information generating module 408 further includes a historical configuration information obtaining module 4081 for obtaining a plurality of pieces of historical task configuration information; screening target task configuration information from the plurality of pieces of historical task configuration information according to a selection instruction of the plurality of pieces of historical task configuration information; and displaying the target task configuration information in the task configuration page.
In another embodiment, the configuration information generation module 408 is further configured to present a task configuration page for an automated test task; determining input information configured for the functional points to be tested in the task configuration page; the input information comprises parameter types, value ranges and input quantity; generating a plurality of normal values and abnormal values corresponding to the parameter types according to the value range; corresponding configuration information is based on the normal value and the abnormal value.
In another embodiment, the execution script acquisition module 404 is further configured to acquire an input number of input parameters corresponding to each function template; copying the function template based on the input quantity to obtain a copy template; and correspondingly filling each input parameter into a copy template to obtain a plurality of execution scripts.
In another embodiment, the test result obtaining module 406 is further configured to sort the function point identifiers of the function points to be tested according to the test sequence, to obtain an identifier sequence; determining one or more execution scripts corresponding to the current function point identification; sequentially running execution scripts to obtain a test result of the functional point to be tested; and taking the function point identifiers which are adjacent to the current function point identifier and are positioned in the next sequence in the identifier sequence as the current function point identifier, and returning to the step of determining the execution script corresponding to the current function point until all the function point identifiers in the identifier sequence are traversed.
In another embodiment, the automated test apparatus 400 further includes a test result display module 410, configured to obtain a test log and a script identifier corresponding to the execution script; according to the script identification, the test log and the corresponding test result are associated to obtain an association list; and generating a test result display page according to the association list, and correspondingly displaying the test result display page.
For specific limitations of the automated test equipment, reference is made to the limitations of the automated test methods described above, and no further description is given here. The various modules in the automated test equipment described above may be implemented in whole or in part in software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing automated test data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements an automated test method.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program:
acquiring configuration information; the configuration information comprises a test sequence of each functional point to be tested, a function template identifier and input parameters corresponding to each function template identifier;
extracting a function template corresponding to the function template identification from a preset function template set;
filling the input parameters into corresponding function templates to obtain execution scripts corresponding to each input parameter;
executing each execution script according to the test sequence to obtain a test result of each functional point to be tested.
In one embodiment, the processor when executing the computer program further performs the steps of:
Displaying a task configuration page of an automatic test task;
determining function template identifiers configured for all function points to be tested in a task configuration page;
when the function template identification is subjected to sorting operation, displaying the sorted function template identification in a task configuration page;
and generating configuration information according to the ordered function template identifiers.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring a plurality of pieces of historical task configuration information;
screening target task configuration information from the plurality of pieces of historical task configuration information according to a selection instruction of the plurality of pieces of historical task configuration information;
and displaying the target task configuration information in the task configuration page.
In one embodiment, the processor when executing the computer program further performs the steps of:
displaying a task configuration page of an automatic test task;
determining input information configured for the functional points to be tested in the task configuration page; the input information comprises parameter types, value ranges and input quantity;
generating a plurality of normal values and abnormal values corresponding to the parameter types according to the value range;
corresponding configuration information is based on the normal value and the abnormal value.
In one embodiment, the configuration information further includes an input number of input parameters; the processor when executing the computer program also implements the steps of:
acquiring the input quantity of input parameters corresponding to each function template;
copying the function template based on the input quantity to obtain a copy template;
and correspondingly filling each input parameter into a copy template to obtain a plurality of execution scripts.
In one embodiment, a plurality of execution scripts corresponding to the function points to be tested are provided; the processor when executing the computer program also implements the steps of:
sorting the function point identifiers of the function points to be tested according to the test sequence to obtain an identifier sequence;
determining one or more execution scripts corresponding to the current function point identification;
sequentially running execution scripts to obtain a test result of the functional point to be tested;
and taking the function point identifiers which are adjacent to the current function point identifier and are positioned in the next sequence in the identifier sequence as the current function point identifier, and returning to the step of determining the execution script corresponding to the current function point until all the function point identifiers in the identifier sequence are traversed.
In one embodiment, the processor when executing the computer program further performs the steps of:
Acquiring a test log and a script identification corresponding to an execution script;
according to the script identification, the test log and the corresponding test result are associated to obtain an association list;
and generating a test result display page according to the association list, and correspondingly displaying the test result display page.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring configuration information; the configuration information comprises a test sequence of each functional point to be tested, a function template identifier and input parameters corresponding to each function template identifier;
extracting a function template corresponding to the function template identification from a preset function template set;
filling the input parameters into corresponding function templates to obtain execution scripts corresponding to each input parameter;
executing each execution script according to the test sequence to obtain a test result of each functional point to be tested.
In one embodiment, the computer program when executed by the processor further performs the steps of:
displaying a task configuration page of an automatic test task;
determining function template identifiers configured for all function points to be tested in a task configuration page;
When the function template identification is subjected to sorting operation, displaying the sorted function template identification in a task configuration page;
and generating configuration information according to the ordered function template identifiers.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a plurality of pieces of historical task configuration information;
screening target task configuration information from the plurality of pieces of historical task configuration information according to a selection instruction of the plurality of pieces of historical task configuration information;
and displaying the target task configuration information in the task configuration page.
In one embodiment, the computer program when executed by the processor further performs the steps of:
displaying a task configuration page of an automatic test task;
determining input information configured for the functional points to be tested in the task configuration page; the input information comprises parameter types, value ranges and input quantity;
generating a plurality of normal values and abnormal values corresponding to the parameter types according to the value range;
corresponding configuration information is based on the normal value and the abnormal value.
In one embodiment, the configuration information further includes an input number of input parameters; the computer program when executed by the processor also performs the steps of:
Acquiring the input quantity of input parameters corresponding to each function template;
copying the function template based on the input quantity to obtain a copy template;
and correspondingly filling each input parameter into a copy template to obtain a plurality of execution scripts.
In one embodiment, a plurality of execution scripts corresponding to the function points to be tested are provided; the computer program when executed by the processor also performs the steps of:
sorting the function point identifiers of the function points to be tested according to the test sequence to obtain an identifier sequence;
determining one or more execution scripts corresponding to the current function point identification;
sequentially running execution scripts to obtain a test result of the functional point to be tested;
and taking the function point identifiers which are adjacent to the current function point identifier and are positioned in the next sequence in the identifier sequence as the current function point identifier, and returning to the step of determining the execution script corresponding to the current function point until all the function point identifiers in the identifier sequence are traversed.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a test log and a script identification corresponding to an execution script;
according to the script identification, the test log and the corresponding test result are associated to obtain an association list;
And generating a test result display page according to the association list, and correspondingly displaying the test result display page.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. An automated testing method, the method comprising:
the method for acquiring the configuration information specifically comprises the following steps: displaying a task configuration page of an automatic test task; determining input information configured for the functional points to be tested in the task configuration page; the input information comprises parameter types, value ranges and input quantity; generating a plurality of normal values and abnormal values corresponding to the parameter types according to the value range; corresponding configuration information based on the normal value and the abnormal value; the configuration information comprises a test sequence of each functional point to be tested, a function template identifier and input parameters corresponding to each function template identifier;
Extracting a function template corresponding to the function template identification from a preset function template set;
filling the input parameters into corresponding function templates to obtain execution scripts corresponding to each input parameter;
and executing each execution script according to the test sequence to obtain a test result of each functional point to be tested.
2. The method according to claim 1, wherein the method further comprises:
determining function template identifiers configured for all function points to be tested in the task configuration page;
when the function template identification is subjected to sorting operation, displaying the sorted function template identification in the task configuration page;
and generating configuration information according to the ordered function template identifiers.
3. The method of claim 2, wherein the task configuration page that presents automated test tasks comprises:
acquiring a plurality of pieces of historical task configuration information;
screening target task configuration information from the plurality of pieces of historical task configuration information according to a selection instruction of the plurality of pieces of historical task configuration information;
and displaying the target task configuration information in a task configuration page.
4. The method of claim 1, wherein the configuration information further includes an input number of input parameters; the step of filling the input parameters into the corresponding function templates to obtain the execution script corresponding to each input parameter comprises the following steps:
Acquiring the input quantity of input parameters corresponding to each function template;
copying the function template based on the input quantity to obtain a copy template;
and correspondingly filling each input parameter into a copy template to obtain a plurality of execution scripts.
5. The method according to claim 1, wherein the execution scripts corresponding to the function points to be tested are plural; executing each execution script according to the test sequence, and obtaining the test result of each functional point to be tested comprises the following steps:
sorting the function point identifiers of the function points to be tested according to the test sequence to obtain an identifier sequence;
determining one or more execution scripts corresponding to the current function point identification;
sequentially running the execution scripts to obtain a test result of the functional point to be tested;
and taking the function point identifiers which are adjacent to the current function point identifier and are positioned in the next sequence in the identifier sequence as the current function point identifier, and returning to the step of determining the execution script corresponding to the current function point until all the function point identifiers in the identifier sequence are traversed.
6. The method according to claim 1, wherein the method further comprises:
Acquiring a test log and a script identification corresponding to the execution script;
according to the script identification, the test log and the corresponding test result are associated to obtain an association list;
and generating a test result display page according to the association list, and correspondingly displaying the test result display page.
7. An automated test equipment, the equipment comprising:
the configuration information acquisition module is used for acquiring configuration information and specifically comprises the following steps: displaying a task configuration page of an automatic test task; determining input information configured for the functional points to be tested in the task configuration page; the input information comprises parameter types, value ranges and input quantity; generating a plurality of normal values and abnormal values corresponding to the parameter types according to the value range; corresponding configuration information based on the normal value and the abnormal value; the configuration information comprises a test sequence of each functional point to be tested, a function template identifier and input parameters corresponding to each function template identifier;
the execution script acquisition module is used for extracting a function template corresponding to the function template identifier from a preset function template set; filling the input parameters into corresponding function templates to obtain execution scripts corresponding to each input parameter;
And the test result acquisition module is used for executing each execution script according to the test sequence to obtain the test result of each functional point to be tested.
8. The apparatus of claim 7, wherein the execution script acquisition module is further configured to acquire an input number of input parameters corresponding to each function template; copying the function template based on the input quantity to obtain a copy template; and correspondingly filling each input parameter into a copy template to obtain a plurality of execution scripts.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202010123717.0A 2020-02-27 2020-02-27 Automated testing method, apparatus, computer device and storage medium Active CN111459796B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010123717.0A CN111459796B (en) 2020-02-27 2020-02-27 Automated testing method, apparatus, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010123717.0A CN111459796B (en) 2020-02-27 2020-02-27 Automated testing method, apparatus, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN111459796A CN111459796A (en) 2020-07-28
CN111459796B true CN111459796B (en) 2024-03-15

Family

ID=71685860

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010123717.0A Active CN111459796B (en) 2020-02-27 2020-02-27 Automated testing method, apparatus, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN111459796B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328482A (en) * 2020-11-05 2021-02-05 中国平安人寿保险股份有限公司 Test method and device based on script template, computer equipment and storage medium
CN113535223B (en) * 2021-07-19 2023-10-24 长鑫存储技术有限公司 Configuration method, device, storage medium and equipment of test flow

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016078335A1 (en) * 2014-11-18 2016-05-26 中兴通讯股份有限公司 Method and apparatus for writing automatic script
WO2018010552A1 (en) * 2016-07-12 2018-01-18 博彦科技股份有限公司 Test method and device
CN107992409A (en) * 2017-11-21 2018-05-04 平安养老保险股份有限公司 Method for generating test case, device, computer equipment and storage medium
CN109783365A (en) * 2018-12-15 2019-05-21 深圳壹账通智能科技有限公司 Automated testing method, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016078335A1 (en) * 2014-11-18 2016-05-26 中兴通讯股份有限公司 Method and apparatus for writing automatic script
WO2018010552A1 (en) * 2016-07-12 2018-01-18 博彦科技股份有限公司 Test method and device
CN107992409A (en) * 2017-11-21 2018-05-04 平安养老保险股份有限公司 Method for generating test case, device, computer equipment and storage medium
CN109783365A (en) * 2018-12-15 2019-05-21 深圳壹账通智能科技有限公司 Automated testing method, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邹才凤 ; 杨志伟 ; .一种模块化的数据驱动测试自动化框架.现代计算机(专业版).2011,(06),全文. *

Also Published As

Publication number Publication date
CN111459796A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN110399293B (en) System test method, device, computer equipment and storage medium
CN108427613B (en) Abnormal interface positioning method and device, computer equipment and storage medium
CN109766261B (en) Coverage test method, coverage test device, computer equipment and storage medium
CN110730107A (en) Test data generation method and device, computer equipment and storage medium
CN110781231A (en) Batch import method, device, equipment and storage medium based on database
CN107451040A (en) Localization method, device and the computer-readable recording medium of failure cause
CN108874661B (en) Test mapping relation library generation method and device, computer equipment and storage medium
CN111475324B (en) Log information analysis method, device, computer equipment and storage medium
CN110471945B (en) Active data processing method, system, computer equipment and storage medium
US10365995B2 (en) Composing future application tests including test action data
CN111459796B (en) Automated testing method, apparatus, computer device and storage medium
CN110321284B (en) Test data entry method, device, computer equipment and storage medium
CN110362479B (en) System upgrade test method and system
CN108268373A (en) Automatic test cases management method, device, equipment and storage medium
CN113282513B (en) Interface test case generation method and device, computer equipment and storage medium
CN104021072A (en) Machine and methods for evaluating failing software programs
CN113342685A (en) Precise test method and device, computer equipment and storage medium
CN111339535A (en) Vulnerability prediction method and system for intelligent contract codes, computer equipment and storage medium
CN111143191A (en) Website testing method and device, computer equipment and storage medium
US20200334092A1 (en) System and method for identifying a cause of a failure in operation of a chip
CN113220588A (en) Automatic testing method, device and equipment for data processing and storage medium
CN109542782B (en) NFC test method and device based on machine learning and computer equipment
CN110865939B (en) Application program quality monitoring method, device, computer equipment and storage medium
CN113886262A (en) Software automation test method and device, computer equipment and storage medium
CN113791980A (en) Test case conversion analysis method, device, equipment and storage medium

Legal Events

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