CN114443473A - Automated testing framework, method, system and computer readable storage medium - Google Patents

Automated testing framework, method, system and computer readable storage medium Download PDF

Info

Publication number
CN114443473A
CN114443473A CN202111647529.9A CN202111647529A CN114443473A CN 114443473 A CN114443473 A CN 114443473A CN 202111647529 A CN202111647529 A CN 202111647529A CN 114443473 A CN114443473 A CN 114443473A
Authority
CN
China
Prior art keywords
test
test case
result
personal computer
industrial personal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111647529.9A
Other languages
Chinese (zh)
Inventor
古欣
成海峰
杨战东
马方方
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Youren Networking Co ltd
Original Assignee
Shandong Youren Networking Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Youren Networking Co ltd filed Critical Shandong Youren Networking Co ltd
Priority to CN202111647529.9A priority Critical patent/CN114443473A/en
Publication of CN114443473A publication Critical patent/CN114443473A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Abstract

The invention discloses an automated testing framework, a method, a system and a computer readable storage medium, wherein the automated testing framework is characterized by comprising the following steps: the industrial personal computer and the tested device are connected with each other; the industrial personal computer is used for sending a test instruction to the tested device according to the test case table; the tested device comprises tested equipment and a plurality of auxiliary equipment which are connected with the industrial personal computer; the tested equipment is used for receiving and executing a test instruction of the industrial personal computer and sending an execution result to the industrial personal computer; and the auxiliary test equipment is used for assisting the tested equipment to carry out automatic test, wherein the tested equipment is in communication connection with the auxiliary test equipment. The invention improves the automation degree of the router test.

Description

Automated testing framework, method, system and computer readable storage medium
Technical Field
The invention relates to the technical field of network automation test, in particular to an automation test framework, a method, a system and a computer readable storage medium.
Background
The router test always takes a long time to perform due to the complicated parameters and complex functions. Therefore, an efficient automatic router testing method is sought, and the effect of achieving twice the result with half the effort can be achieved. The automatic realization of the router test mainly considers the realization from two directions, namely the entry test (static test) of a web page and the actual function test (dynamic test) of the router, wherein the function test comprises parameter validity verification after parameter transmission and also comprises a functional working logic flow.
When the function test of the router is carried out, the patent document with the publication number of CN112333019A describes a configuration and test method and system of the router and a readable storage medium, but the above test system has the disadvantages that firstly, a plurality of test devices are required to carry out cooperative test, that is, a plurality of pcs are required to be operated in a time-sharing manner to send configuration and query commands, a control system with unified management is lacked, and the degree of automation is low; and secondly, the test range is relatively small and is limited to compatibility test of upper and lower equipment such as WAN/LAN/WIFI.
Therefore, the existing router testing method has low automation degree and smaller testing range.
Disclosure of Invention
It is a primary object of the present invention to provide an automated testing framework, method, system and computer-readable storage medium. The router testing method aims to solve the problems that an existing router testing method is low in automation degree and small in testing range.
To achieve the above object, the present invention provides an automated test framework, comprising:
the industrial personal computer and the tested device are connected with each other;
the industrial personal computer is used for sending a test instruction to the tested device according to the test case table;
the tested device comprises tested equipment and a plurality of auxiliary equipment which are connected with the industrial personal computer;
the tested equipment is used for receiving and executing a test instruction of the industrial personal computer and sending an execution result to the industrial personal computer;
and the auxiliary test equipment is used for assisting the tested equipment to carry out automatic test, wherein the tested equipment is in communication connection with the auxiliary test equipment.
In addition, in order to achieve the above object, the present invention further provides an automated testing method, which is applied to an automated testing framework, where the automated testing framework includes an industrial personal computer and a device to be tested, where the industrial personal computer, and the device to be tested include a device to be tested and an auxiliary device to be tested; the automatic test method comprises the following steps:
the control industrial personal computer receives and analyzes the test case table, controls the tested equipment to execute the automatic test according to the test case table and generates an execution result;
judging whether the automatic test is finished or not according to the execution result and the test case table;
and if the automatic test is finished, finishing the test and exporting the target test case form after the automatic test is finished.
Optionally, the test case table includes a plurality of test cases, and the test cases include a plurality of test scripts;
the step of controlling the tested equipment to carry out automatic testing according to the test case table and generating the execution result comprises the following steps:
sequentially executing test case scripts according to the test case tables and generating test instructions corresponding to the test case scripts;
judging whether the tested equipment needs to feed back a test result corresponding to the test instruction or not according to the test instruction;
if the test result does not need to be fed back by the tested equipment, executing the following steps:
and executing the next test case script according to the test case until all test scripts in the test case are executed, and outputting an execution result.
Optionally, after the step of determining whether it is necessary to receive a test result corresponding to the test instruction fed back by the test device according to the test instruction, the method further includes:
if the tested equipment needs to feed back a test result, controlling the industrial personal computer to send the test instruction to the tested equipment according to the first preset interface and receive the test result according to the second preset interface;
judging whether the test result is correct or not according to a preset result;
if the test result is correct, executing the following steps: executing the next test case script according to the test case until all test scripts in the test case are completely executed, and outputting an execution result
Optionally, after the step of sending the test instruction to the device to be tested according to the first preset interface and receiving the test result according to the second preset interface, the industrial personal computer further includes:
if the tested equipment does not receive the test instruction within the preset time or the industrial personal computer does not receive the test result within the preset time, the test instruction is sent to the tested equipment
When the tested equipment does not receive the test instruction within preset time, judging whether the industrial personal computer needs to resend the test instruction; and
when the industrial personal computer does not receive the test result within the preset time, judging whether the tested equipment needs to resend the test result;
and if the test instruction does not need to be sent again or the test result does not need to be sent again, outputting an execution result corresponding to the test script.
Optionally, after the steps of determining whether the industrial personal computer needs to resend the test instruction and determining whether the device under test needs to resend the test result, the method further includes:
if the test instruction needs to be retransmitted or the test result needs to be retransmitted, judging whether the retransmission times are reached according to the test case table;
if the retransmission times are reached, outputting an execution result corresponding to the test case;
if the number of times of resending is not reached, executing the following steps: and the control industrial personal computer sends the test instruction to the tested equipment according to the first preset interface and receives the test result according to the second preset interface.
Optionally, the step of determining whether the automated test is completed according to the execution result and the test case table includes:
judging whether a next test case exists in the test case table or not according to the execution result and the test case table;
if the next test case exists, judging that the automatic test is not finished, and executing the following steps: and sequentially executing the test case scripts according to the test case tables, and generating test instructions corresponding to the test case scripts.
Optionally, after the step of determining whether there is a next test case in the test case table, the method further includes:
if the next test case does not exist, the automatic test is finished according to the execution result, and the automatic test is judged to be finished.
In addition, in order to achieve the above object, the present invention further provides an automated testing system, which includes an automated testing framework, a memory, a processor, and an automated testing program stored in the memory and capable of running on the processor, wherein the automated testing program, when executed by the processor, implements the steps of the automated testing method described above.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium having an automated testing program stored thereon, which, when executed by a processor, implements the steps of the automated testing method as described above.
The invention provides an automated testing framework, a method, a system and a computer readable storage medium, wherein the automated testing framework comprises the following components: the industrial personal computer and the tested device are connected with each other; the industrial personal computer is used for sending a test instruction to the tested device according to the test case table; the tested device comprises tested equipment and a plurality of auxiliary equipment which are connected with the industrial personal computer; the tested equipment is used for receiving and executing a test instruction of the industrial personal computer and sending an execution result to the industrial personal computer; and the auxiliary test equipment is used for assisting the tested equipment to carry out automatic test, wherein the tested equipment is in communication connection with the auxiliary test equipment. The automatic testing method comprises the following steps: the control industrial personal computer receives and analyzes the test case table, controls the tested equipment to execute the automatic test according to the test case table and generates an execution result; judging whether the automatic test is finished or not according to the execution result and the test case table; and if the automatic test is finished, finishing the test and exporting the target test case form after the automatic test is finished. Through the structure and the mode, the designed test script can be analyzed through the industrial personal computer, the configuration instruction is sent to the tested equipment and the auxiliary equipment thereof according to the sequence of the test script, then the required test data is obtained through the query instruction or the data transmission instruction and is compared with the expected result in the script, and the result is automatically output. The test script can intuitively embody the product parameters and the logic flow of the test, replaces manual test to a great extent, and realizes the standardization of the test. An industrial personal computer controls the motion of the tested equipment and the auxiliary equipment through an upper computer; the test range is wider, the test is not limited to the compatibility of the equipment for testing, more functional tests can be realized, and the automation degree and the test range are improved.
Drawings
FIG. 1 is a schematic diagram of an apparatus in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an automated testing framework according to the present invention;
FIG. 3 is a diagram illustrating a structure of a test case table in the automated testing method according to the present invention;
FIG. 4 is a flowchart illustrating a first exemplary embodiment of an automated testing method according to the present invention;
FIG. 5 is a flowchart illustrating a second exemplary embodiment of an automated testing method according to the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal in the embodiment of the invention is an automatic test system, and can also be a mobile terminal device with a touch function, such as a smart phone, a tablet computer, a portable computer and the like which are provided with the automatic test system.
As shown in fig. 1, the terminal may include: a processor 1001, e.g., a CPU, a communication bus 1002, a user interface 1003, a DVI interface 1004, a USB interface 1005, and a memory 1006. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The DVI interface 1004 may optionally include a standard wired interface to connect with other external devices via DVI wires. The USB interface 1005 may optionally include a standard wired interface for connecting with other external devices via a USB cable. The memory 1006 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 1006 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include an audio circuit and the like, which are not described in detail herein.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, the memory 1006, which is a type of computer storage medium, may include therein an operating system, a DVI interface module, a USB interface module, a user interface module, and an automation test program.
In the terminal shown in fig. 1, the DVI interface 1004 is mainly used for connecting, and communicating data with, external devices; the USB interface 1005 is mainly used for connecting an external device and performing data communication with the external device; the user interface 1003 is mainly used for connecting a client and performing data communication with the client; and the processor 1001 may be configured to invoke the automated test program stored in the memory 1005 and perform the following operations:
the control industrial personal computer receives and analyzes the test case table, controls the tested equipment to execute the automatic test according to the test case table and generates an execution result;
judging whether the automatic test is finished or not according to the execution result and the test case table;
and if the automatic test is finished, finishing the test and exporting the target test case form after the automatic test is finished.
Further, the processor 1001 may invoke an automated test program stored in the memory 1006, and also perform the following operations:
the test case table comprises a plurality of test cases, and the test cases comprise a plurality of test scripts;
the step of controlling the tested equipment to carry out automatic testing according to the test case table and generating the execution result comprises the following steps:
sequentially executing test case scripts according to the test case tables and generating test instructions corresponding to the test case scripts;
judging whether the tested equipment needs to feed back a test result corresponding to the test instruction or not according to the test instruction;
if the test result does not need to be fed back by the tested equipment, executing the following steps:
and executing the next test case script according to the test case until all test scripts in the test case are executed, and outputting an execution result.
Further, the processor 1001 may invoke an automated test program stored in the memory 1006, and also perform the following operations:
after the step of judging whether the test result corresponding to the test instruction needs to be fed back by the test equipment according to the test instruction, the method further comprises the following steps:
if the tested equipment needs to feed back a test result, controlling the industrial personal computer to send the test instruction to the tested equipment according to the first preset interface and receive the test result according to the second preset interface;
judging whether the test result is correct or not according to a preset result;
if the test result is correct, executing the following steps: executing the next test case script according to the test case until all test scripts in the test case are completely executed, and outputting an execution result
Further, the processor 1001 may invoke an automated test program stored in the memory 1006, and also perform the following operations:
the control industrial computer sends the test instruction to the equipment that receives according to first preset interface to after the step of receiving the test result according to second preset interface, still include:
if the tested equipment does not receive the test instruction within the preset time or the industrial personal computer does not receive the test result within the preset time, the tested equipment and the industrial personal computer are connected in series
When the tested equipment does not receive the test instruction within preset time, judging whether the industrial personal computer needs to resend the test instruction; and
when the industrial personal computer does not receive the test result within the preset time, judging whether the tested equipment needs to resend the test result;
and if the test instruction does not need to be sent again or the test result does not need to be sent again, outputting an execution result corresponding to the test script.
Further, the processor 1001 may invoke an automated test program stored in the memory 1006, and also perform the following operations:
after the step of judging whether the industrial personal computer needs to resend the test instruction and the step of judging whether the tested equipment needs to resend the test result, the method further comprises the following steps:
if the test instruction needs to be retransmitted or the test result needs to be retransmitted, judging whether the retransmission times are reached according to the test case table;
if the retransmission times are reached, outputting an execution result corresponding to the test case;
if the number of times of resending is not reached, executing the following steps: and the control industrial personal computer sends the test instruction to the tested equipment according to the first preset interface and receives the test result according to the second preset interface.
Further, the processor 1001 may invoke an automated test program stored in the memory 1006, and also perform the following operations:
the step of judging whether the automatic test is finished according to the execution result and the test case table comprises the following steps:
judging whether a next test case exists in the test case table or not according to the execution result and the test case table;
if the next test case exists, judging that the automatic test is not finished, and executing the following steps: and sequentially executing the test case scripts according to the test case table, and generating test instructions corresponding to the test case scripts.
Further, the processor 1001 may invoke an automated test program stored in the memory 1006 to also perform the following operations:
after the step of judging whether the next test case exists in the test case table, the method further comprises the following steps:
and if the next test case does not exist, ending the automatic test according to the execution result, and judging that the automatic test is finished.
Based on the hardware structure, the invention provides various embodiments of the automatic test system.
Referring to fig. 2, fig. 2 is a schematic structural diagram of an automated testing framework according to the present invention, the automated testing framework includes: the industrial personal computer 01 and the tested device 02 are connected with each other; the industrial personal computer 01 is used for sending a test instruction to the tested device 02 according to a test case table; the tested device 02 comprises tested equipment 022 and a plurality of auxiliary equipment 021 which are connected with the industrial personal computer 01; the tested device 022 is used for receiving and executing the test instruction of the industrial personal computer 01 and sending an execution result to the industrial personal computer 01; the auxiliary device 021 is configured to assist the device under test 022 in performing an automated test, wherein the device under test 022 is communicatively connected to the auxiliary device 021.
In this embodiment, the industrial computer with receive the equipment and the industrial computer with assist and be connected through different serial ports that differ promptly between the equipment, of course, can also be connected through other communication modes, for example wireless connection modes such as bluetooth, WIFI. The device under test and the auxiliary device are connected by wireless or wired connection, and the invention is not limited herein. For better description, in the subsequent embodiments of the present invention, the industrial personal computer and the auxiliary devices are connected by serial ports, in this embodiment, the number of devices connected to the industrial personal computer is 3, or other number of devices, not limited to within three, based on the number of serial ports supported by the actual industrial personal computer. The industrial personal computer runs upper computer software, can analyze the test case table, generates a test instruction according to the analyzed test case, and tests the tested equipment and the auxiliary equipment. The tested equipment is a router; the number of the auxiliary equipment is 2, and the auxiliary equipment can be specifically a router or other embeddable terminals; the invention is applied to the functional test of the router, and particularly comprises but is not limited to (1) service test: and base station information, wherein the auxiliary equipment is required to provide TCPS or UDPS. (2) The method is applied to VPN test, and auxiliary equipment is required to provide VPN Server and verify subnet intercommunication in a networking way. (3) Applied to network testing, comprising: the interface, LAN and WAN need the auxiliary device to provide DHCP Server or DHCP Client. (4) And (4) firewall testing, namely, needing functions of assisting a device DHCP Client, providing TCPS UDPS and the like. (5) In the network port mode, auxiliary equipment is required to provide a DHCP Server or a DHCP Client. (6) And (4) system test, remote log, auxiliary test equipment is required to provide the storage number of the UDPS/local log and the compressed packet name.
In this embodiment, through above-mentioned automatic test framework, can realize that an industrial computer carries out the function of same control management to many tested devices, improves the degree of automation of router function test, realizes the multiple function test of router simultaneously, improves the compatibility of test routing equipment.
Referring to fig. 3, the present invention provides an automated testing method, in a first embodiment of the automated testing method of an automated testing system, the automated testing method includes the steps of:
step S10, controlling an industrial personal computer to receive and analyze the test case table, controlling the tested equipment to execute the automated test according to the test case table, and generating an execution result;
in this embodiment, the test case table includes a plurality of test cases, each test case includes a plurality of test case scripts, and the industrial personal computer sequentially executes each test case in the test case table according to the test case scripts until all the test cases are executed. The execution result comprises pass and fail corresponding to the test case, and the two results are obtained.
In another embodiment, before the step S10, the method further includes:
and constructing a test case table, and importing the test case table into an industrial personal computer.
In this embodiment, referring to fig. 4, fig. 4 is a structure diagram of a test case table, where the test case table is an excel table, each line is a test case script in a unit of line, and the test case sequence number, a case summary, a command type, a serial number to be sent, a command to configure a script/query parameter instruction, a next instruction sending interval time, whether it is necessary to judge whether to return a result, a result feedback serial number, an expected result, a result comparison mode, a time-out time to wait for an instruction reply, an action after a failure, a number of retry failures, a result, and a remark are sequentially arranged from left to right. The test case serial number is a test case ID, and one test case ID comprises a plurality of lines of test case scripts. The case summary is used for describing the test function of the test case and is not included in the script analysis of the industrial personal computer. The command types comprise configuration, query and data, and are used for providing a flag bit for subsequent script execution failure and conveniently locating failure reasons. And the transmitted serial port number is used for the industrial personal computer to select the serial port selected by the local line command. The configuration script command/query parameter instruction is used for a command for configuration, query or transmitted data. The next instruction sending interval is the next instruction sending time interval after the instruction of the current line is sent. And judging whether to return a result, wherein the judgment comprises yes and no, and the yes is default setting. The result feedback serial port number is used for selecting a serial port for receiving the comparison data, wherein the serial port may be different from the sent serial port number; the default value defaults to a transmission serial number. The expected result is used for receiving the test result. The result comparison mode comprises accurate comparison; fuzzy contrast; directly obtaining without comparison; three ways. And the waiting instruction reply time is overtime waiting time after the instruction is sent, and if the instruction is not replied within the waiting time, the test is defined as test failure. The action after failure is to select the operation to be executed after the result comparison fails or the overtime waiting fails, and the action after failure is retried, stopped and ignored. And after the test result is tested, the upper computer automatically fills the test result, including Pass and Fail. The remarks are used for assisting in explaining and explaining the use case script.
In the embodiment, by constructing the test case table and importing the test case table into the industrial personal computer, the product parameters and the logic flow of the test can be visually embodied, manual testing is replaced to a great extent, the standardization of the test is realized, and through script configuration, different equipment parameters can be manually configured instead of each test, so that an automatic scene is realized.
Step S20, according to the execution result and the test case table, judging whether the automatic test is completed;
in an embodiment, the step S20 further includes:
step A21, judging whether the test case table contains the next test case according to the execution result and the test case table;
step A22, if there is a next test case, determining that the automated test is not completed, and executing the steps: sequentially executing test case scripts according to the test case tables and generating test instructions corresponding to the test case scripts;
and step A23, if the next test case does not exist, ending the automated test according to the execution result, and judging that the automated test is finished.
In this embodiment, the execution result includes a pass result or a fail result corresponding to each test case, and since a plurality of test cases exist in the test case table, it is determined that the automated test is completed only after all the test cases are executed, and therefore it is necessary to determine whether a next test case exists, and when the next test case exists, execute a test script in the next test case; and when the next test case does not exist, storing the execution result into a test case table, and judging that the automatic test is finished.
And step S30, if the automatic test is finished, ending the test, and exporting the target test case table after the automatic test is finished.
In this embodiment, the target test table includes the test case data in the above embodiment before the test is executed, and the execution result of each test case after the test is executed. After the automatic test is finished, all log information is output and stored in real time. The final result of the router test can be clearly and obviously displayed through the target test case table, so that the automatic test degree is high.
The invention provides an automatic testing method, which comprises the following steps: the control industrial personal computer receives and analyzes the test case table, controls the tested equipment to execute the automatic test according to the test case table and generates an execution result; judging whether the automatic test is finished or not according to the execution result and the test case table; and if the automatic test is finished, finishing the test and exporting the target test case form after the automatic test is finished. According to the method, the designed test script can be analyzed through the industrial personal computer, the configuration instruction is sent to the tested equipment and the auxiliary equipment thereof according to the sequence of the test script, then the required test data is obtained through the query instruction or the data transmission instruction, and compared with the expected result in the script, and the result is automatically output. The test script can intuitively embody the product parameters and the logic flow of the test, replaces manual test to a great extent, and realizes the standardization of the test. An industrial personal computer controls the motion of the tested equipment and the auxiliary equipment through the upper computer; the test range is wider, the test is not limited to the compatibility of the equipment for testing, more functional tests can be realized, and the automation degree and the test range are improved.
Further, referring to fig. 5, a second embodiment of the automated testing method according to the present invention provides an automated testing method, based on the embodiment shown in fig. 3, where the test case table includes a plurality of test cases, and the test cases include a plurality of test scripts;
the step of controlling the tested equipment to carry out automatic testing according to the test case table and generating the execution result comprises the following steps:
step S11, executing test case scripts in sequence according to the test case tables, and generating test instructions corresponding to the test case scripts;
in this embodiment, the test instruction includes three test instructions, namely configuration, query, and data. The test case table may be generated according to a command type in the test case table.
Step S12, judging whether the tested equipment needs to feed back the test result corresponding to the test instruction according to the test instruction;
in this embodiment, the determination may be specifically made according to "whether it is necessary to determine a return result" in the test case table.
In step S13, if the test result does not need to be fed back by the device under test, the following steps are executed:
and executing the next test case script according to the test case until all the test scripts in the test case are executed, and outputting an execution result.
In this embodiment, if all test case scripts in the test case pass, the execution result is determined that the test case passes the test; and if one test case script in the test cases fails, judging that the test case script fails according to the execution result.
In an embodiment, after the step S12, the method further includes:
step S14, if the tested device needs to feed back the test result, the industrial personal computer is controlled to send the test instruction to the tested device according to the first preset interface, and the test result is received according to the second preset interface;
in this embodiment, the test result is a test result of the test case script. The industrial personal computer is connected with the tested equipment and the auxiliary equipment through serial port lines, the first preset interface and the second preset interface are serial port serial numbers corresponding to the serial port lines and are stored in the test case table, specifically, the first preset interface is stored in the serial port number sent by the test case table in the embodiment, and the second preset interface is stored in the result feedback serial port number. The second preset interface can be a serial port identical to the first preset interface, and also can be other serial ports between the industrial personal computer and the auxiliary equipment. Each serial port can be independently set through a script, the opening and closing of the serial port is controlled, parameters are set, and data are sent. Through different interface feedback and received data, can realize assisting the conversion of equipment and the equipment that is surveyed, both can test the equipment that is surveyed, also can test auxiliary equipment, realized the scalability of test.
Step S15, judging whether the test result is correct or not according to a preset result;
in this embodiment, the preset result is stored in an "expected result" in the test case table, when the industrial personal computer receives a test result fed back by the device to be tested, the test result is compared with the expected result, and if the test result is the same as the expected result, the test result is judged to be correct; and if the test result is the same as the expected result, determining that the test result is wrong. If no content exists in the "expected result", the test result is directly filled in the expected result, and step S16 is executed.
Step S16, if the test result is correct, executing the steps of: and executing the next test case script according to the test case until all test scripts in the test case are executed, and outputting an execution result.
In this embodiment, if the test result is correct, the next test case script is executed until the test case script is completely executed.
If the test result is wrong, judging whether the test case script needs to be sent again according to the test case table, and if not, judging that the execution result of the test case corresponding to the test case script is failed; if necessary, step S16 is executed.
According to the test case table, sequentially executing the test case scripts and generating test instructions corresponding to the test case scripts; judging whether the tested equipment needs to feed back a test result corresponding to the test instruction or not according to the test instruction; if the test result does not need to be fed back by the tested equipment, executing the following steps: and executing the next test case script according to the test case until all test scripts in the test case are executed, and outputting an execution result. The judgment of the execution result of the test case is realized, and the function of the automatic test of the test case is realized.
Further, a third embodiment of the automated testing method according to the present invention provides an automated testing method, based on the embodiment shown in fig. 3, after the step of controlling the industrial personal computer to send the test instruction to the device under test according to the first preset interface and receive the test result according to the second preset interface, the automated testing method further includes:
step A17, if the tested device does not receive the test instruction within the preset time, or the industrial personal computer does not receive the test result within the preset time, then
When the tested equipment does not receive the test instruction within preset time, judging whether the industrial personal computer needs to resend the test instruction; and
in this embodiment, the preset time may be defined according to a "wait for instruction reply timeout" in the test case table.
A18, when the industrial personal computer does not receive the test result within a preset time, judging whether the tested equipment needs to resend the test result;
in this embodiment, whether the test result needs to be resent may be determined according to a "failed action" in the test case table, where the "failed action" includes retrying, stopping, and ignoring (continuing to execute a next script), and corresponding operations are executed according to the actions.
Step A19, if the test command does not need to be sent again or the test result does not need to be sent again, outputting the execution result corresponding to the test script.
In this embodiment, if the test instruction or the test result does not need to be sent, the test case is directly ended, and the execution result is determined to be a failure and is output.
Step A191, if the test instruction needs to be resent or the test result needs to be resent, judging whether the resending times are reached according to the test case table;
in this embodiment, whether the retransmission times are reached may be determined according to the "number of failed retries" in the test case table.
Step A192, if the retransmission times are reached, outputting an execution result corresponding to the test case;
step A193, if the number of times of retransmission is not reached, executing the steps of: and the control industrial personal computer sends the test instruction to the tested equipment according to the first preset interface and receives the test result according to the second preset interface.
In this embodiment, if the number of retransmissions is reached, it is directly determined that the execution result of the test case is a failure. And if the retransmission times are not reached, testing the test case again.
In the invention, the test time is saved and the test efficiency is improved by judging that the tested equipment does not receive the test instruction within the preset time or the industrial personal computer does not receive the test result within the preset time.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where an automation test program is stored on the computer-readable storage medium, and when executed by a processor, the automation test program implements the following operations:
the control industrial personal computer receives and analyzes the test case table, controls the tested equipment to execute the automatic test according to the test case table and generates an execution result;
judging whether the automatic test is finished or not according to the execution result and the test case table;
and if the automatic test is finished, finishing the test and exporting the target test case form after the automatic test is finished.
Further, the automated test program when executed by the processor further performs the following operations:
the test case table comprises a plurality of test cases, and the test cases comprise a plurality of test scripts;
the step of controlling the tested equipment to carry out automatic testing according to the test case table and generating the execution result comprises the following steps:
sequentially executing test case scripts according to the test case tables and generating test instructions corresponding to the test case scripts;
judging whether the tested equipment needs to feed back a test result corresponding to the test instruction or not according to the test instruction;
if the test result does not need to be fed back by the tested equipment, executing the following steps:
and executing the next test case script according to the test case until all test scripts in the test case are executed, and outputting an execution result.
Further, the automated test program when executed by the processor further performs the following operations:
after the step of judging whether the test result corresponding to the test instruction needs to be fed back by the test equipment according to the test instruction, the method further comprises the following steps:
if the tested equipment needs to feed back a test result, controlling the industrial personal computer to send the test instruction to the tested equipment according to the first preset interface and receive the test result according to the second preset interface;
judging whether the test result is correct or not according to a preset result;
if the test result is correct, executing the following steps: and executing the next test case script according to the test case until all test scripts in the test case are executed, and outputting an execution result.
Further, the automated test program when executed by the processor further performs the following operations:
the control industrial computer sends the test instruction to the equipment that receives according to first preset interface to after the step of receiving the test result according to second preset interface, still include:
if the tested equipment does not receive the test instruction within the preset time or the industrial personal computer does not receive the test result within the preset time, the tested equipment and the industrial personal computer are connected in series
When the tested equipment does not receive the test instruction within preset time, judging whether the industrial personal computer needs to resend the test instruction; and
when the industrial personal computer does not receive the test result within the preset time, judging whether the tested equipment needs to resend the test result;
and if the test instruction does not need to be sent again or the test result does not need to be sent again, outputting an execution result corresponding to the test script.
Further, the automated test program when executed by the processor further performs the following operations:
after the step of judging whether the industrial personal computer needs to resend the test instruction and the step of judging whether the tested equipment needs to resend the test result, the method further comprises the following steps:
if the test instruction needs to be retransmitted or the test result needs to be retransmitted, judging whether the retransmission times are reached according to the test case table;
if the retransmission times are reached, outputting an execution result corresponding to the test case;
if the number of times of resending is not reached, executing the following steps: and the control industrial personal computer sends the test instruction to the tested equipment according to the first preset interface and receives the test result according to the second preset interface.
Further, the automated test program when executed by the processor further performs the following operations:
the step of judging whether the automatic test is finished according to the execution result and the test case table comprises the following steps:
judging whether a next test case exists in the test case table or not according to the execution result and the test case table;
if the next test case exists, judging that the automatic test is not finished, and executing the following steps: and sequentially executing the test case scripts according to the test case table, and generating test instructions corresponding to the test case scripts.
Further, the automated test program when executed by the processor further performs the following operations:
after the step of judging whether the next test case exists in the test case table, the method further comprises the following steps:
and if the next test case does not exist, ending the automatic test according to the execution result, and judging that the automatic test is finished.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the automated testing method described above, and is not repeated herein.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An automated test framework, comprising:
the industrial personal computer and the tested device are connected with each other;
the industrial personal computer is used for sending a test instruction to the tested device according to the test case table;
the tested device comprises tested equipment and a plurality of auxiliary equipment which are connected with the industrial personal computer;
the tested equipment is used for receiving and executing a test instruction of the industrial personal computer and sending an execution result to the industrial personal computer;
and the auxiliary test equipment is used for assisting the tested equipment to carry out automatic test, wherein the tested equipment is in communication connection with the auxiliary test equipment.
2. An automatic test method is characterized in that the automatic test method is applied to an automatic test frame, the automatic test frame comprises an industrial personal computer and a tested device, wherein the industrial personal computer and the tested device comprise tested equipment and auxiliary test equipment; the automatic test method comprises the following steps:
the control industrial personal computer receives and analyzes the test case table, controls the tested equipment to execute the automatic test according to the test case table and generates an execution result;
judging whether the automatic test is finished or not according to the execution result and the test case table;
and if the automatic test is finished, finishing the test and exporting the target test case form after the automatic test is finished.
3. The automated testing method of claim 2, wherein the test case table comprises a number of test cases, the test cases comprising a number of test scripts;
the step of controlling the tested equipment to carry out automatic testing according to the test case table and generating the execution result comprises the following steps:
sequentially executing test case scripts according to the test case tables and generating test instructions corresponding to the test case scripts;
judging whether the tested equipment needs to feed back a test result corresponding to the test instruction or not according to the test instruction;
if the test result does not need to be fed back by the tested equipment, executing the following steps:
and executing the next test case script according to the test case until all test scripts in the test case are executed, and outputting an execution result.
4. The automated testing method of claim 3, wherein after the step of determining whether the test result corresponding to the test instruction needs to be fed back by the receiving testing device according to the test instruction, the method further comprises:
if the tested equipment needs to feed back a test result, controlling the industrial personal computer to send the test instruction to the tested equipment according to the first preset interface and receive the test result according to the second preset interface;
judging whether the test result is correct or not according to a preset result;
if the test result is correct, the steps are executed: and executing the next test case script according to the test case until all test scripts in the test case are executed, and outputting an execution result.
5. The automated testing method of claim 4, wherein after the steps of sending the test instruction to the device under test by the control industrial personal computer according to a first preset interface and receiving the test result according to a second preset interface, the method further comprises:
if the tested equipment does not receive the test instruction within the preset time or the industrial personal computer does not receive the test result within the preset time, the tested equipment and the industrial personal computer are connected in series
When the tested equipment does not receive the test instruction within preset time, judging whether the industrial personal computer needs to resend the test instruction; and
when the industrial personal computer does not receive the test result within the preset time, judging whether the tested equipment needs to resend the test result;
and if the test instruction does not need to be sent again or the test result does not need to be sent again, outputting an execution result corresponding to the test script.
6. The automated testing method of claim 5, wherein after the steps of determining whether the industrial personal computer needs to resend the test instruction and determining whether the device under test needs to resend the test result, the method further comprises:
if the test instruction needs to be retransmitted or the test result needs to be retransmitted, judging whether the retransmission times are reached according to the test case table;
if the retransmission times are reached, outputting an execution result corresponding to the test case;
if the number of times of resending is not reached, executing the following steps: and the control industrial personal computer sends the test instruction to the tested equipment according to the first preset interface and receives the test result according to the second preset interface.
7. The automated testing method of claim 3, wherein the step of determining whether the automated testing is complete according to the execution result and the test case table comprises:
judging whether a next test case exists in the test case table or not according to the execution result and the test case table;
if the next test case exists, judging that the automatic test is not finished, and executing the following steps: and sequentially executing the test case scripts according to the test case table, and generating test instructions corresponding to the test case scripts.
8. The automated testing method of claim 7, wherein after the step of determining whether there is a next test case in the test case table, further comprising:
and if the next test case does not exist, ending the automatic test according to the execution result, and judging that the automatic test is finished.
9. An automated test system comprising an automated test framework and a memory, a processor and an automated test program stored on the memory and executable on the processor, the automated test program when executed by the processor implementing the steps of the automated test method of any one of claims 2 to 8.
10. A computer-readable storage medium, having an automated test program stored thereon, which when executed by a processor implements the steps of the automated test method of any of claims 2 to 8.
CN202111647529.9A 2021-12-29 2021-12-29 Automated testing framework, method, system and computer readable storage medium Pending CN114443473A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111647529.9A CN114443473A (en) 2021-12-29 2021-12-29 Automated testing framework, method, system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111647529.9A CN114443473A (en) 2021-12-29 2021-12-29 Automated testing framework, method, system and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114443473A true CN114443473A (en) 2022-05-06

Family

ID=81365798

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111647529.9A Pending CN114443473A (en) 2021-12-29 2021-12-29 Automated testing framework, method, system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114443473A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991710A (en) * 2023-06-27 2023-11-03 珠海妙存科技有限公司 Automatic test method and system, electronic equipment and storage medium thereof

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090307763A1 (en) * 2008-06-05 2009-12-10 Fiberlink Communications Corporation Automated Test Management System and Method
CN103812726A (en) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 Automated testing method and device for data communication equipment
CN104768177A (en) * 2015-04-22 2015-07-08 福州大学 Automated Android equipment Wi-Fi module function testing method
CN108459953A (en) * 2017-02-22 2018-08-28 北京京东尚科信息技术有限公司 test method and device
CN111194046A (en) * 2018-11-14 2020-05-22 上海富瀚微电子股份有限公司 Automatic WIFI module testing system and method
CN112333019A (en) * 2020-10-30 2021-02-05 展讯半导体(成都)有限公司 Router configuration and test method and system and readable storage medium
CN112783794A (en) * 2021-02-10 2021-05-11 西南电子技术研究所(中国电子科技集团公司第十研究所) Aviation communication radio station software test system
CN113485919A (en) * 2021-06-30 2021-10-08 山东有人物联网股份有限公司 Test method, test device and computer readable storage medium
CN113722213A (en) * 2021-08-13 2021-11-30 苏州浪潮智能科技有限公司 Automated testing method and computer-readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090307763A1 (en) * 2008-06-05 2009-12-10 Fiberlink Communications Corporation Automated Test Management System and Method
CN103812726A (en) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 Automated testing method and device for data communication equipment
CN104768177A (en) * 2015-04-22 2015-07-08 福州大学 Automated Android equipment Wi-Fi module function testing method
CN108459953A (en) * 2017-02-22 2018-08-28 北京京东尚科信息技术有限公司 test method and device
CN111194046A (en) * 2018-11-14 2020-05-22 上海富瀚微电子股份有限公司 Automatic WIFI module testing system and method
CN112333019A (en) * 2020-10-30 2021-02-05 展讯半导体(成都)有限公司 Router configuration and test method and system and readable storage medium
CN112783794A (en) * 2021-02-10 2021-05-11 西南电子技术研究所(中国电子科技集团公司第十研究所) Aviation communication radio station software test system
CN113485919A (en) * 2021-06-30 2021-10-08 山东有人物联网股份有限公司 Test method, test device and computer readable storage medium
CN113722213A (en) * 2021-08-13 2021-11-30 苏州浪潮智能科技有限公司 Automated testing method and computer-readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991710A (en) * 2023-06-27 2023-11-03 珠海妙存科技有限公司 Automatic test method and system, electronic equipment and storage medium thereof
CN116991710B (en) * 2023-06-27 2024-04-09 珠海妙存科技有限公司 Automatic test method and system, electronic equipment and storage medium thereof

Similar Documents

Publication Publication Date Title
CN107276864B (en) Method, device and system for controlling household appliances by intelligent voice equipment
CN101478449B (en) Protocol automatic test method and system thereof
CN102546266B (en) Method and platform for diagnosing network failures
CN109376088B (en) Automatic test system and automatic test method
CN104461897A (en) Application program test method and device
CN111475417A (en) Automatic testing method, device, equipment and storage medium
CN111404779B (en) Method, device and system for testing role switching of router nodes
CN114443473A (en) Automated testing framework, method, system and computer readable storage medium
CN111193602A (en) Automatic operation and maintenance management system and method
CN111858336B (en) Automatic software testing method and system
CN102664756B (en) Device access method, device and system
CN115514667A (en) Access service processing method, system, device, electronic equipment and storage medium
CN109729346B (en) Remote debugging method and system for television, debugging terminal and television terminal
CN105515890A (en) OpenFlow protocol consistency testing method and equipment
CN111212155B (en) Log debugging method, television and storage medium
CN108874659B (en) Test method, test system and server of digital currency computing equipment
CN105243015B (en) Method and system for automatically testing software
CN105827462A (en) Method and tool for detecting network device
KR100706747B1 (en) Method and system for remote controlling the mobile terminal
CN115801852A (en) Method, client, server and system for controlling lower computer
CN113794602A (en) Equipment testing method and device, terminal equipment and storage medium
CN108199918B (en) Method and system for testing washing machine
CN112351074A (en) Network distribution method and device, electronic equipment and storage medium
CN111541589A (en) Method, device and equipment for testing expansion module interface of intelligent terminal
CN111007737B (en) Device control method, device control apparatus, and computer-readable 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