WO2016201997A1 - 一种自动化测试的方法、装置及系统 - Google Patents

一种自动化测试的方法、装置及系统 Download PDF

Info

Publication number
WO2016201997A1
WO2016201997A1 PCT/CN2016/073672 CN2016073672W WO2016201997A1 WO 2016201997 A1 WO2016201997 A1 WO 2016201997A1 CN 2016073672 W CN2016073672 W CN 2016073672W WO 2016201997 A1 WO2016201997 A1 WO 2016201997A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration
mode
device under
under test
configuration command
Prior art date
Application number
PCT/CN2016/073672
Other languages
English (en)
French (fr)
Inventor
郇昌波
樊志强
李素林
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016201997A1 publication Critical patent/WO2016201997A1/zh

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

Definitions

  • the present invention relates to automated testing techniques, and more particularly to a method, apparatus and system for automated testing.
  • Automated testing has gradually penetrated into all aspects of software testing and has irreplaceable advantages. A lot of repetitive operations can be achieved using simple scripts in automated testing. Therefore, to some extent, automated testing not only shortens the test time, saves the test manpower, but also makes the test results more accurate. In addition, automated testing frees up the human resources used in testing, allowing testers to focus more on manual testing, improving test efficiency, ultimately shortening product development cycles and improving R&D efficiency.
  • the TCP connection between the automated test system and the device will be abnormally interrupted. Usually when such a situation is encountered, it not only causes the running script to fail, but even affects the subsequent automated test execution.
  • the present invention provides a method, apparatus and system for automated testing.
  • the present invention provides a method of automated testing, wherein the method comprises:
  • the process of testing a device under test according to a test script detecting whether an abnormal interruption occurs in the connection with the device under test, and if an abnormal interruption occurs, determining that the last device of the device under test in the test script is successfully executed.
  • the configuration command and the configuration command that the device under test fails to be executed; and the configuration mode that matches the last successful execution configuration command is obtained according to the last configuration command that is successfully executed; and according to the acquired configuration mode,
  • the device under test is configured such that the configuration mode of the device under test is restored to a configuration mode that matches the last successful configuration command.
  • the obtaining, according to the configuration command that is successfully executed by the last one, the configuration mode that matches the configuration command that is successfully executed by the last one includes: searching for a configuration according to the last successful configuration command. Corresponding relationship between the command and the configuration mode; obtaining a configuration mode that matches the last successful configuration command according to the correspondence between the configuration command and the configuration mode.
  • the searching for a correspondence between a configuration command and a configuration mode includes: searching a system mode database in the automated test system, and acquiring, from the system mode database, a configuration command that is successfully executed with the last one.
  • a matching configuration mode wherein a correspondence between the configuration command and the configuration mode is pre-configured in the system mode database.
  • configuring, according to the acquired configuration mode, the device to be tested including: rebuilding Establishing a connection with the device under test, and then configuring the reconnected device under test according to the acquired configuration mode, so that the configuration mode of the device under test is restored to a configuration command that is successfully executed with the last one. Matching configuration mode.
  • the method further includes: following another configuration command after the last configuration command of the device under test in the test script is executed successfully Obtaining a configuration mode that matches the other configuration commands, configuring the device to be tested according to the acquired configuration mode that matches the other configuration commands, and sending the device to the device under test The device performs a configuration command that fails, and the failed device performs the configuration command by the device under test.
  • an apparatus for automated testing comprising: an abnormality detecting unit, configured to detect and test a device during testing of a device under test according to a test script Whether the connection between the connection is abnormally interrupted, and if an abnormal interruption occurs, determining that the last configuration command of the device under test in the test script is successfully executed and the configuration command that the device under test fails to execute; the mode storage unit is configured to a configuration command that is successfully executed, and a configuration mode that matches the configuration command that is successfully executed by the last one is obtained.
  • the mode execution unit is configured to configure the device under test according to the acquired configuration mode, so that the The configuration mode of the device under test is restored to the configuration mode that matches the last successful configuration command.
  • the mode storage unit is configured to: search for a correspondence between a configuration command and a configuration mode according to the configuration command that is successfully executed according to the last one; and according to the correspondence between the configuration command and the configuration mode, Gets the configuration mode that matches the last successful configuration command.
  • the mode storage unit is configured to search a system mode database in the automated test system, and obtain, from the system mode database, a configuration mode that matches a configuration command that is successfully executed by the last one, where The correspondence between the configuration command and the configuration mode is pre-configured in the system mode database.
  • the mode execution unit is configured to re-establish a connection with the device under test, and then configure the reconnected device under test according to the acquired configuration mode, so that the configuration mode of the device under test is configured. Restores to the configuration mode that matches the last successful configuration command.
  • the device further includes a test execution unit, where the mode storage unit is configured to acquire the other configuration command according to another configuration command after the last configuration command of the device under test in the test script is successfully executed. a configuration mode in which the command is matched; the mode execution unit is configured to configure the device under test according to the acquired configuration mode that matches the other configuration commands; the test execution unit is configured to The test device sends a configuration command that the device under test fails, and the failed device performs the configuration command.
  • an automated test system comprising means for automated testing.
  • the method for automated testing provided by the present invention is to test a device under test according to a test script. During the process, if the connection with the device under test is abnormally interrupted, the last configuration command of the device under test in the test script and the configuration command that the device under test fails to be executed are determined, and then the configuration command is successfully executed according to the last one. Obtain the corresponding configuration mode, and finally configure the device under test according to the obtained configuration mode, so that the configuration mode of the device under test is restored to the configuration mode that matches the last successful configuration command.
  • the invention ensures the continuity of the automated test by correctly restoring the configuration mode of the device under test.
  • FIG. 1 is a flow chart showing the main steps of a method for automated testing in an embodiment of the present invention
  • Figure 2 is a flow chart showing the detailed steps of the method of automated testing in an embodiment of the present invention
  • Fig. 3 is a block diagram showing the construction of an apparatus for automated testing in an embodiment of the present invention.
  • a flowchart of main steps of a method for automated testing in an embodiment of the present invention includes the following steps:
  • Step 101 Detect whether a connection between the device under test and the device under test is abnormally interrupted. If an abnormal interrupt occurs, determine a configuration command that is successfully executed by the device under test in the test script and a configuration command that the device under test fails to execute.
  • the automated test system executes the test scripts in the order in which the test scripts are executed.
  • the connection between the automated test system and the device under test is interrupted, it is detected whether the interrupt between the automated test system and the device under test is abnormally interrupted. If it is abnormally interrupted, it is determined that the test script is tested. The last successful configuration command of the device and the configuration command that the device under test failed.
  • the determined last successful execution configuration command may be the return value of the last successful configuration command.
  • the identity of the device under test may also be determined.
  • Step 102 Acquire a configuration mode that matches the last successful configuration command according to the last successful configuration command.
  • the automated test system can obtain the configuration mode that matches the last successful configuration command according to the return value of the last successful configuration command.
  • the protocols in the default configuration mode include Border Gateway Protocol BGP, Open Shortest Path First Protocol OSPF, Link State Routing Protocol ISIS, and Routing Information Protocol RIP; interfaces in the default configuration mode This includes VLAN interfaces, port interfaces, loopback interfaces, and ATM interfaces.
  • Step 103 Configure the device under test according to the acquired configuration mode.
  • the configuration command fails to be executed directly on the device under test
  • the configuration mode of the device under test may be incorrect, and the device may fail to continue to be configured.
  • Automated testing fails, so properly restoring the configuration mode of the device under test is the key to continuing automated testing.
  • the automated test system can configure the device under test according to the acquired configuration mode, that is, the configuration mode that matches the last successful configuration command of the device under test, so that the configuration mode of the device under test is restored.
  • the configuration mode in which the last successful configuration command matches, that is, the device under test is restored to the correct configuration mode.
  • the connection between the automated test system and the device under test is abnormally interrupted, the first configuration command of the device under test in the test script is successfully executed, and the configuration command for the device under test fails to be executed, and then the last execution is successful according to the last one.
  • the configuration command obtains the corresponding configuration mode, and finally configures the device under test according to the acquired configuration mode, so that the configuration mode of the device under test is restored to the configuration mode that matches the last successful configuration command, that is, the measured device is tested.
  • the device is restored to the correct configuration mode.
  • the invention ensures the continuity of the automated test by correctly restoring the configuration mode of the device under test.
  • FIG. 2 is a flow chart of detailed steps of a method for automated testing in an embodiment of the present invention, including the following steps:
  • Step 201 Test a device under test according to a test script.
  • Step 202 Detect whether an abnormal interruption occurs in the connection with the device under test.
  • Step 203 If the connection with the device under test is abnormally interrupted, determine that the last configuration command of the device under test in the test script is successfully executed, and the configuration command that the device under test fails to execute.
  • the configuration command for the last successful execution of the device under test in the test script and the configuration command for the device under test to fail are determined.
  • the determined last successful execution configuration command may be the return value of the last successful configuration command.
  • the identity of the device under test may also be determined.
  • Step 204 Find a correspondence between a configuration command and a configuration mode, and obtain a configuration mode that matches a last successful configuration command.
  • Step 205 re-establishing a connection with the device under test, and reconnecting according to the acquired configuration mode. Configure the device under test.
  • connection with the device under test is re-established.
  • the configuration of the device under test may be configured.
  • the mode is incorrect, so that the device under test fails to continue configuration, and finally the subsequent automated test fails. Therefore, correctly restoring the configuration mode of the device under test is the key to continuing the automated test. Therefore, the reconnected device under test needs to be configured according to the acquired configuration mode, so that the configuration mode of the device under test is restored to the configuration mode that matches the last successful configuration command, that is, the device under test is restored to the correct mode. Configuration mode.
  • Step 206 Configure the device under test according to the obtained configuration mode that matches other configuration commands.
  • the automated test system will automatically execute the successful configuration command according to the last device in the test script. Configure the configuration mode to match the configuration commands of other configuration commands. Then, configure the device to be tested according to the configuration mode that matches other configuration commands.
  • the other configuration commands after the last successful execution of the configuration command in the test script include the configuration command that the device under test fails to execute, and the configuration command after the configuration command that the device under test fails.
  • Step 207 Send a configuration command that the device under test fails to be sent to the device under test.
  • the automated test system sends a configuration command to the device under test to fail the execution of the device under test, and the device under test continues to perform the failed configuration. command.
  • the device under test continues to execute other configuration commands in the test script according to the preset sequence of the test script.
  • the apparatus for automated testing includes:
  • the abnormality detecting unit 301 is configured to detect whether a connection between the device under test and the device under test is abnormally interrupted during testing according to a test script, and if the abnormal interrupt occurs, determine the device under test in the test script.
  • the mode storage unit 302 is configured to acquire a configuration mode that matches the last successful configuration command according to the last successful configuration command;
  • the unit 303 is configured to configure the device under test according to the acquired configuration mode, so that the configuration mode of the device under test is restored to a configuration mode that matches a last successful configuration command.
  • the mode storage unit 302 is further configured to: search for a correspondence between a configuration command and a configuration mode according to a configuration command that is successfully executed by the last one; and obtain, according to the correspondence between the configuration command and the configuration mode, The last configuration mode that matches the successful configuration command.
  • the mode storage unit 302 is further configured to: search a system mode database in the automated test system, and obtain, from the system mode database, a configuration mode that matches a last successful configuration command, where the system mode database is pre- There is a correspondence between the configuration command and the configuration mode.
  • the mode execution unit 303 is further configured to re-establish a connection with the device under test, and then configure the reconnected device under test according to the acquired configuration mode, so that the configuration mode of the device under test is restored to the last A configuration mode that matches successful configuration commands.
  • the device further includes a test execution unit, wherein the mode storage unit 302 is further configured to acquire a configuration mode that matches other configuration commands according to other configuration commands after the last configuration command of the device under test in the test script executes a successful configuration command.
  • the mode execution unit 303 is further configured to configure the device under test according to the acquired configuration mode that matches other configuration commands; the test execution unit is configured to send a configuration command that the device under test fails to be executed to the device under test, The device under test executes the failed configuration command.
  • an automated test system comprising means for automated testing.
  • the apparatus for automated testing described above is configured to perform the method of automated testing described above.
  • the device for the automated test can be a computer, a server, or the like.
  • the apparatus for automated testing may include at least one of a processing component, a memory, a power component, an input and output interface, and a communication component.
  • the processing component can perform all operations of the device for automated testing, such as data communication, recording operations, and the like.
  • Processing components may include one or more processors for executing instructions to implement all or a portion of the steps above.
  • the processing component can include one or more modules that facilitate interaction between the processing component and other components.
  • the memory is configured to store various types of data to support the operation of the device for automated testing. Examples of such data include instructions, messages, etc. of any application or method running on an automated test device.
  • the memory can be implemented using any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Disk or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM erasable programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Disk Disk or Optical Disk.
  • the power components provide power to the various components of the automated test device.
  • the input/output interface provides an interface between the processing component and the peripheral interface module, and the peripheral interface module may be a keyboard, a click wheel, a button, or the like.
  • the communication component is configured to facilitate wired or wireless communication between the device for automated testing and other devices.
  • non-transitory computer readable storage medium comprising instructions, such as a memory comprising instructions executable by a processor of an automatically tested device to perform the above method.
  • the non-transitory computer readable storage medium described above may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.
  • the invention is applicable to an automated test system for correctly restoring the configuration mode of the device under test and ensuring the continuity of the automated test.

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

一种自动化测试的方法、装置及系统,其中,自动化测试的方法包括:在根据一测试脚本对一被测设备进行测试的过程中,检测与被测设备之间的连接是否发生异常中断,若发生异常中断,则确定所述测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令(101);根据所述最后一条执行成功的配置命令,获取与所述最后一条执行成功的配置命令相匹配的配置模式(102);根据所获取的配置模式,对所述被测设备进行配置(103),使得所述被测设备的配置模式恢复到与所述最后一条执行成功的配置命令相匹配的配置模式。通过正确恢复被测设备的配置模式,保证了自动化测试的连续性。

Description

一种自动化测试的方法、装置及系统 技术领域
本发明涉及自动化测试技术,尤其是涉及一种自动化测试的方法、装置及系统。
背景技术
自动化测试已经逐渐深入到软件测试的各个方面,有着不可替代的优势。自动化测试中使用简单的脚本就能够实现大量重复的操作。因此,在一定程度上自动化测试不仅缩短了测试时间,节约了测试人力,而且使得测试结果更加准确。此外,自动化测试释放了测试所用的人力资源,使得测试人员能够更加专注于手工测试部分,提高了测试的效率,最终缩短了产品开发的周期,提高了研发效率。
但是在自动化测试过程中,因被测设备的性能、测试环境的稳定性以及其他等不稳定因素,自动化测试系统与设备之间的传输控制协议TCP连接会发生异常中断。通常遇到此类情况时,不仅导致正在执行的脚本运行失败,甚至会影响后续的自动化测试执行。
发明内容
为了保证自动化测试的连续性,本发明提供了一种自动化测试的方法、装置及系统。
为了实现上述目的,本发明提供了一种自动化测试的方法,其中,所述方法包括:
在根据一测试脚本对一被测设备进行测试的过程中,检测与被测设备之间的连接是否发生异常中断,若发生异常中断,则确定所述测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令;根据所述最后一条执行成功的配置命令,获取与所述最后一条执行成功的配置命令相匹配的配置模式;根据所获取的配置模式,对所述被测设备进行配置,使得所述被测设备的配置模式恢复到与所述最后一条执行成功的配置命令相匹配的配置模式。
可选的,所述根据所述最后一条执行成功的配置命令,获取与所述最后一条执行成功的配置命令相匹配的配置模式,包括:根据所述最后一条执行成功的配置命令,查找一配置命令与配置模式之间的对应关系;根据所述配置命令与配置模式之间的对应关系,获取与最后一条执行成功的配置命令相匹配的配置模式。
可选的,所述查找一配置命令与配置模式之间的对应关系,包括:搜索自动化测试系统中的系统模式数据库,从所述系统模式数据库中获取到与所述最后一条执行成功的配置命令相匹配的配置模式,其中,所述系统模式数据库中预设有所述配置命令与配置模式之间的对应关系。
可选的,所述根据所获取的配置模式,对所述被测设备进行配置,包括:重新建 立与所述被测设备的连接,然后根据所获取的配置模式,对重新连接的被测设备进行配置,使得所述被测设备的配置模式恢复到与所述最后一条执行成功的配置命令相匹配的配置模式。
可选的,所述根据所获取的配置模式,对所述被测设备进行配置之后,所述方法还包括:根据所述测试脚本中被测设备最后一条执行成功的配置命令之后的其他配置命令,获取与所述其他配置命令相匹配的配置模式;根据获取到的与所述其他配置命令相匹配的配置模式,对所述被测设备进行配置;向所述被测设备下发所述被测设备执行失败的配置命令,由所述被测设备执行所述失败的配置命令。
依据本发明的另一个方面,还提供了一种自动化测试的装置,所述装置包括:异常检测单元,用于在根据一测试脚本对一被测设备进行测试的过程中,检测与被测设备之间的连接是否发生异常中断,若发生异常中断,则确定所述测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令;模式存储单元,用于根据所述最后一条执行成功的配置命令,获取与所述最后一条执行成功的配置命令相匹配的配置模式;模式执行单元,用于根据所获取的配置模式,对所述被测设备进行配置,使得所述被测设备的配置模式恢复到与所述最后一条执行成功的配置命令相匹配的配置模式。
可选的,所述模式存储单元用于,根据所述最后一条执行成功的配置命令,查找一配置命令与配置模式之间的对应关系;根据所述配置命令与配置模式之间的对应关系,获取与最后一条执行成功的配置命令相匹配的配置模式。
可选的,所述模式存储单元用于,搜索自动化测试系统中的系统模式数据库,从所述系统模式数据库中获取到与所述最后一条执行成功的配置命令相匹配的配置模式,其中,所述系统模式数据库中预设有所述配置命令与配置模式之间的对应关系。
可选的,所述模式执行单元用于,重新建立与所述被测设备的连接,然后根据所获取的配置模式,对重新连接的被测设备进行配置,使得所述被测设备的配置模式恢复到与所述最后一条执行成功的配置命令相匹配的配置模式。
可选的,所述装置还包括测试执行单元,其中,所述模式存储单元用于根据所述测试脚本中被测设备最后一条执行成功的配置命令之后的其他配置命令,获取与所述其他配置命令相匹配的配置模式;所述模式执行单元用于根据获取到的与所述其他配置命令相匹配的配置模式,对所述被测设备进行配置;所述测试执行单元用于向所述被测设备下发所述被测设备执行失败的配置命令,由所述被测设备执行所述失败的配置命令。
依据本发明的另一个方面,还提供了一种自动化测试系统,所述自动化测试系统包括自动化测试的装置。
本发明的有益效果是:
本发明提供的自动化测试的方法,在根据一测试脚本对一被测设备进行测试的过 程中,若与被测设备之间的连接发生异常中断,则确定测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令,然后根据最后一条执行成功的配置命令获取相应的配置模式,最后根据获取的配置模式,对被测设备进行配置,以使被测设备的配置模式恢复到与最后一条执行成功的配置命令相匹配的配置模式。本发明通过正确恢复被测设备的配置模式,保证了自动化测试的连续性。
附图说明
图1表示本发明的实施例中自动化测试的方法的主要步骤流程图;
图2表示本发明的实施例中自动化测试的方法的详细步骤流程图;以及
图3表示本发明的实施例中自动化测试的装置的结构框图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
如图1所示,为本发明的实施例中自动化测试的方法的主要步骤流程图,包括如下步骤:
步骤101,检测与被测设备之间的连接是否发生异常中断,若发生异常中断,则确定测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令。
在本步骤中,在自动化测试系统根据一测试脚本对一被测设备进行测试的过程中,自动化测试系统按照测试脚本的既定顺序依次执行测试脚本。在测试过程中,若自动化测试系统与被测设备之间的连接发生中断,则检测自动化测试系统与被测设备之间的中断是否为异常中断,若为异常中断,则确定测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令。
具体的,确定的最后一条执行成功的配置命令可以为最后一条执行成功的配置命令的返回值。可选的,若自动化测试系统与被测设备之间的连接为异常中断,还可以确定被测设备的标识。
步骤102,根据最后一条执行成功的配置命令,获取与最后一条执行成功的配置命令相匹配的配置模式。
在本步骤中,具体的,自动化测试系统可以根据最后一条执行成功的配置命令的返回值,获取与最后一条执行成功的配置命令相匹配的配置模式。
其中,默认的配置模式中的协议包括边界网关协议BGP、开放最短路径优先协议OSPF、链接状态路由协议ISIS和路由信息协议RIP等;默认的配置模式中的接口 包括VLAN接口、port接口、Loopback接口和ATM接口等。
步骤103,根据所获取的配置模式,对被测设备进行配置。
在本步骤中,具体的,若直接在被测设备上继续执行失败的配置命令,则可能会因为被测设备的配置模式不正确,从而发生被测设备继续配置失败的情况,最后导致后续的自动化测试失败,因此正确恢复被测设备的配置模式,是继续进行自动化测试的关键。
基于上述原因,自动化测试系统可以根据所获取的配置模式,即与被测设备最后一条执行成功的配置命令相匹配的配置模式,对被测设备进行配置,使得被测设备的配置模式恢复到与最后一条执行成功的配置命令相匹配的配置模式,即使得被测设备恢复到正确的配置模式。
本发明在自动化测试系统与被测设备之间的连接发生异常中断时,首先确定测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令,然后根据最后一条执行成功的配置命令获取相应的配置模式,最后根据获取的配置模式,对被测设备进行配置,使得被测设备的配置模式恢复到与最后一条执行成功的配置命令相匹配的配置模式,即使得被测设备恢复到正确的配置模式。本发明通过正确恢复被测设备的配置模式,保证了自动化测试的连续性。
如图2所示,为本发明的实施例中自动化测试的方法的详细步骤流程图,包括如下步骤:
步骤201,根据一测试脚本对一被测设备进行测试。
步骤202,检测与被测设备之间的连接是否发生异常中断。
步骤203,若与被测设备之间的连接发生异常中断,则确定测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令。
在本步骤中,若自动化测试系统与被测设备之间的连接发生异常中断,则确定测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令。
具体的,确定的最后一条执行成功的配置命令可以为最后一条执行成功的配置命令的返回值。可选的,若自动化测试系统与被测设备之间的连接为异常中断,还可以确定被测设备的标识。
步骤204,查找一配置命令与配置模式之间的对应关系,获取与最后一条执行成功的配置命令相匹配的配置模式。
在本步骤中,可以根据最后一条执行成功的配置命令,查找一配置命令与配置模式之间的对应关系,然后根据配置命令与配置模式之间的对应关系,获取与最后一条执行成功的配置命令相匹配的配置模式。具体的,可以搜索自动化测试系统中的系统模式数据库,其中,系统模式数据库中预设有配置命令与配置模式之间的对应关系,然后从系统模式数据库中获取到与最后一条执行成功的配置命令相匹配的配置模式。
步骤205,重新建立与被测设备的连接,根据所获取的配置模式,对重新连接的 被测设备进行配置。
在本步骤中,重新建立与被测设备的连接,在重新建立与被测设备之间的连接后,若直接在被测设备上继续执行失败的配置命令,则可能会因为被测设备的配置模式不正确,从而发生被测设备继续配置失败的情况,最后导致后续的自动化测试失败,因此正确恢复被测设备的配置模式,是继续进行自动化测试的关键。因此需要根据所获取的配置模式,对重新连接的被测设备进行配置,使得被测设备的配置模式恢复到与最后一条执行成功的配置命令相匹配的配置模式,即使得被测设备恢复到正确的配置模式。
步骤206,根据获取到的与其他配置命令相匹配的配置模式,对被测设备进行配置。
在本步骤中,当根据与最后一条执行成功的配置命令相匹配的配置模式对被测设备进行配置之后,自动化测试系统将自动根据测试脚本中被测设备最后一条执行成功的配置命令之后的其他配置命令,获取与其他配置命令相匹配的配置模式,然后根据获取到的与其他配置命令相匹配的配置模式,对被测设备进行配置。
具体的,测试脚本中被测设备最后一条执行成功的配置命令之后的其他配置命令包括被测设备执行失败的配置命令及该被测设备执行失败的配置命令之后的配置命令。
步骤207,向被测设备下发被测设备执行失败的配置命令。
在本步骤中,当被测设备恢复至执行失败的配置命令相匹配的配置模式之后,自动化测试系统向被测设备下发被测设备执行失败的配置命令,由被测设备继续执行失败的配置命令。
具体的,当被测设备继续执行失败的配置命令之后,被测设备按照测试脚本的预设顺序继续执行测试脚本中其他的配置命令。
如图3所示,为本发明的实施例中自动化测试的装置的结构框图,自动化测试的装置包括:
异常检测单元301,用于在根据一测试脚本对一被测设备进行测试的过程中,检测与被测设备之间的连接是否发生异常中断,若发生异常中断,则确定测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令;模式存储单元302,用于根据最后一条执行成功的配置命令,获取与最后一条执行成功的配置命令相匹配的配置模式;模式执行单元303,用于根据所获取的配置模式,对被测设备进行配置,使得被测设备的配置模式恢复到与最后一条执行成功的配置命令相匹配的配置模式。
可选的,模式存储单元302进一步用于,根据最后一条执行成功的配置命令,查找一配置命令与配置模式之间的对应关系;根据所述配置命令与配置模式之间的对应关系,获取与最后一条执行成功的配置命令相匹配的配置模式。
可选的,模式存储单元302进一步用于,搜索自动化测试系统中的系统模式数据库,从系统模式数据库中获取到与最后一条执行成功的配置命令相匹配的配置模式,其中,系统模式数据库中预设有配置命令与配置模式之间的对应关系。
可选的,模式执行单元303进一步用于,重新建立与被测设备的连接,然后根据所获取的配置模式,对重新连接的被测设备进行配置,使得被测设备的配置模式恢复到与最后一条执行成功的配置命令相匹配的配置模式。
可选的,装置还包括测试执行单元,其中,模式存储单元302进一步用于根据测试脚本中被测设备最后一条执行成功的配置命令之后的其他配置命令,获取与其他配置命令相匹配的配置模式;模式执行单元303进一步用于根据获取到的与其他配置命令相匹配的配置模式,对被测设备进行配置;测试执行单元用于向被测设备下发被测设备执行失败的配置命令,由被测设备执行失败的配置命令。
依据本发明的另一个方面,还提供了一种自动化测试系统,自动化测试系统包括自动化测试的装置。
上述自动化测试的装置被配置为执行上述自动化测试的方法。该自动化测试的装置可以是计算机、服务器等。该自动化测试的装置可以包括处理部件、存储器、电力部件、输入输出接口、通信部件中的至少一个。
处理部件可以执行自动化测试的装置的全部操作,例如数据通信、记录操作等。处理部件可以包括一个或多个处理器,用以执行指令以实施上述方法中的所有或部分步骤。而且,处理部件可以包括利于处理部件与其他部件之间交互的一个或多个模块。
存储器被配置为存储各种类型的数据以支持自动化测试的装置的操作。这种数据的示例包括在自动化测试的装置上运行的任意应用或方法的指令、消息等。存储器可以使用任何类型的易失性或非易失性存储器件或其组合来实施,例如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电力组件为自动化测试的装置的各种组件提供电力。
输入输出接口为处理组件和外围接口模块之间提供接口,上述外围接口模块可以是键盘、点击轮、按钮等。
通信组件被配置为便于自动化测试的装置和其他设备之间有线或者无线方式的通信。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器,上述指令可由自动化测试的装置的处理器执行以完成上述方法。例如,上述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
以上所述的是本发明的优选实施方式,应当指出对于本技术领域的普通人员来 说,在不脱离本发明所述的原理前提下还可以作出若干改进和润饰,这些改进和润饰也在本发明的保护范围内。
工业实用性
本发明适用于自动化测试系统,用以正确恢复被测设备的配置模式,保证自动化测试的连续性。

Claims (11)

  1. 一种自动化测试的方法,包括:
    在根据一测试脚本对一被测设备进行测试的过程中,检测与被测设备之间的连接是否发生异常中断,若发生异常中断,则确定所述测试脚本中被测设备最后一条执行成功的配置命令以及被测设备执行失败的配置命令;
    根据所述最后一条执行成功的配置命令,获取与所述最后一条执行成功的配置命令相匹配的配置模式;
    根据所获取的配置模式,对所述被测设备进行配置,使得所述被测设备的配置模式恢复到与所述最后一条执行成功的配置命令相匹配的配置模式。
  2. 根据权利要求1所述的方法,其中,所述根据所述最后一条执行成功的配置命令,获取与所述最后一条执行成功的配置命令相匹配的配置模式,包括:
    根据所述最后一条执行成功的配置命令,查找一配置命令与配置模式之间的对应关系;
    根据所述配置命令与配置模式之间的对应关系,获取与最后一条执行成功的配置命令相匹配的配置模式。
  3. 根据权利要求2所述的方法,其中,所述查找一配置命令与配置模式之间的对应关系,包括;
    搜索自动化测试系统中的系统模式数据库,从所述系统模式数据库中获取到与所述最后一条执行成功的配置命令相匹配的配置模式,其中,所述系统模式数据库中预设有所述配置命令与配置模式之间的对应关系。
  4. 根据权利要求1所述的方法,其中,所述根据所获取的配置模式,对所述被测设备进行配置,包括:
    重新建立与所述被测设备的连接,然后根据所获取的配置模式,对重新连接的被测设备进行配置,使得所述被测设备的配置模式恢复到与所述最后一条执行成功的配置命令相匹配的配置模式。
  5. 根据权利要求1所述的方法,其中,所述根据所获取的配置模式,对所述被测设备进行配置之后,所述方法还包括:
    根据所述测试脚本中被测设备最后一条执行成功的配置命令之后的其他配置命令,获取与所述其他配置命令相匹配的配置模式;
    根据获取到的与所述其他配置命令相匹配的配置模式,对所述被测设备进行配置;
    向所述被测设备下发所述被测设备执行失败的配置命令,由所述被测设备执行所述失败的配置命令。
  6. 一种自动化测试的装置,其中,所述装置包括:
    异常检测单元,设置为在根据一测试脚本对一被测设备进行测试的过程中,检测与被测设备之间的连接是否发生异常中断,若发生异常中断,则确定所述测试脚本中被测设备 最后一条执行成功的配置命令以及被测设备执行失败的配置命令;
    模式存储单元,设置为根据所述最后一条执行成功的配置命令,获取与所述最后一条执行成功的配置命令相匹配的配置模式;
    模式执行单元,设置为根据所获取的配置模式,对所述被测设备进行配置,使得所述被测设备的配置模式恢复到与所述最后一条执行成功的配置命令相匹配的配置模式。
  7. 根据权利要求6所述的装置,其中,所述模式存储单元进一步设置为,根据所述最后一条执行成功的配置命令,查找一配置命令与配置模式之间的对应关系;根据所述配置命令与配置模式之间的对应关系,获取与最后一条执行成功的配置命令相匹配的配置模式。
  8. 根据权利要求7所述的装置,其中,所述模式存储单元进一步设置为,搜索自动化测试系统中的系统模式数据库,从所述系统模式数据库中获取到与所述最后一条执行成功的配置命令相匹配的配置模式,其中,所述系统模式数据库中预设有所述配置命令与配置模式之间的对应关系。
  9. 根据权利要求6所述的装置,其中,所述模式执行单元进一步设置为,重新建立与所述被测设备的连接,然后根据所获取的配置模式,对重新连接的被测设备进行配置,使得所述被测设备的配置模式恢复到与所述最后一条执行成功的配置命令相匹配的配置模式。
  10. 根据权利要求6所述的装置,其中,所述装置还包括测试执行单元,其中,所述模式存储单元进一步设置为根据所述测试脚本中被测设备最后一条执行成功的配置命令之后的其他配置命令,获取与所述其他配置命令相匹配的配置模式;所述模式执行单元进一步设置为根据获取到的与所述其他配置命令相匹配的配置模式,对所述被测设备进行配置;所述测试执行单元设置为向所述被测设备下发所述被测设备执行失败的配置命令,由所述被测设备执行所述失败的配置命令。
  11. 一种自动化测试系统,其中,所述自动化测试系统包括如权利要求6~10任一项所述的自动化测试的装置。
PCT/CN2016/073672 2015-06-16 2016-02-05 一种自动化测试的方法、装置及系统 WO2016201997A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510334351.0A CN106326089B (zh) 2015-06-16 2015-06-16 一种自动化测试的方法、装置及系统
CN201510334351.0 2015-06-16

Publications (1)

Publication Number Publication Date
WO2016201997A1 true WO2016201997A1 (zh) 2016-12-22

Family

ID=57544980

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/073672 WO2016201997A1 (zh) 2015-06-16 2016-02-05 一种自动化测试的方法、装置及系统

Country Status (2)

Country Link
CN (1) CN106326089B (zh)
WO (1) WO2016201997A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111722997A (zh) * 2019-03-21 2020-09-29 福建天晴在线互动科技有限公司 自动化测试的异常检测方法及计算机可读存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577591A (zh) * 2016-07-05 2018-01-12 中兴通讯股份有限公司 一种自动化测试异常保护的方法、装置及系统
CN113866602A (zh) * 2021-09-24 2021-12-31 嘉兴威伏半导体有限公司 一种基于晶圆测试设备和mes系统的联动回收方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050165974A1 (en) * 2004-01-23 2005-07-28 Nec Corporation Computer apparatus and computer system
CN101458652A (zh) * 2007-12-14 2009-06-17 上海海尔集成电路有限公司 微控制器嵌入式在线仿真调试系统
CN101551777A (zh) * 2009-05-08 2009-10-07 刘志方 移动终端软件基于异常和中断机制的装置和测试方法
CN101989225A (zh) * 2009-07-29 2011-03-23 中兴通讯股份有限公司 基于断点的自动化测试方法及装置
CN102882615A (zh) * 2012-09-24 2013-01-16 广东欧珀移动通信有限公司 一种td-scdma射频性能自动化测试方法
CN103812726A (zh) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 一种数据通信设备的自动化测试方法及装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI235446B (en) * 2004-04-19 2005-07-01 Powerchip Semiconductor Corp Auto recovery wafer testing apparatus and wafer testing method
US20060100982A1 (en) * 2004-11-08 2006-05-11 International Business Machines Corporation Storage configuration loader with automatic error recovery
CN100361105C (zh) * 2005-05-17 2008-01-09 北京中星微电子有限公司 中断处理中恢复访问环境设置的方法及装置
CN101159605B (zh) * 2007-10-25 2012-09-05 中兴通讯股份有限公司 一种可实现状态记忆和恢复的流程控制方法
CN101996107A (zh) * 2009-08-31 2011-03-30 中国工商银行股份有限公司 一种作业中断自动恢复系统及方法
CN104516796B (zh) * 2013-09-29 2019-05-14 中兴通讯股份有限公司 一种基于命令集的网元备份与恢复方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050165974A1 (en) * 2004-01-23 2005-07-28 Nec Corporation Computer apparatus and computer system
CN101458652A (zh) * 2007-12-14 2009-06-17 上海海尔集成电路有限公司 微控制器嵌入式在线仿真调试系统
CN101551777A (zh) * 2009-05-08 2009-10-07 刘志方 移动终端软件基于异常和中断机制的装置和测试方法
CN101989225A (zh) * 2009-07-29 2011-03-23 中兴通讯股份有限公司 基于断点的自动化测试方法及装置
CN102882615A (zh) * 2012-09-24 2013-01-16 广东欧珀移动通信有限公司 一种td-scdma射频性能自动化测试方法
CN103812726A (zh) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 一种数据通信设备的自动化测试方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111722997A (zh) * 2019-03-21 2020-09-29 福建天晴在线互动科技有限公司 自动化测试的异常检测方法及计算机可读存储介质
CN111722997B (zh) * 2019-03-21 2023-05-23 福建天晴在线互动科技有限公司 自动化测试的异常检测方法及计算机可读存储介质

Also Published As

Publication number Publication date
CN106326089B (zh) 2020-03-27
CN106326089A (zh) 2017-01-11

Similar Documents

Publication Publication Date Title
CN110908909B (zh) 自动化测试方法、装置、存储介质及设备
WO2018006702A1 (zh) 自动化测试中的异常处理方法、装置及系统
US20150277804A1 (en) SAN IP Validation Tool
WO2018095414A1 (zh) 虚拟机故障的检测和恢复方法及装置
CN111026645A (zh) 用户界面自动化测试方法、装置、存储介质及电子设备
WO2016201997A1 (zh) 一种自动化测试的方法、装置及系统
WO2017028574A1 (zh) 一种路由器测试方法和测试装置
WO2016082543A1 (zh) 一种设备检测方法及检测设备
CN107357694A (zh) 开机自检过程中错误事件汇报系统及其方法
US9612935B2 (en) Enhanced resiliency testing by enabling state level control for request
CN115422048A (zh) 链路稳定性测试方法、装置、计算机设备和存储介质
US20160112285A1 (en) Apparatus and method for detecting abnormal connection
CN108075933B (zh) 一种网络互通性测试方法及装置
CN108307414B (zh) 应用程序的Wi-Fi连接异常处理方法、装置、终端及存储介质
CN110134558B (zh) 一种服务器的检测方法和装置
CN107870840B (zh) 基于ipmi的服务器多个测试指令自动执行方法
US9628364B2 (en) Test automation system and method for detecting change in signature of internet application traffic protocol
CN115794525A (zh) 一种bmc压力测试方法、装置、设备及存储介质
CN107612786B (zh) 一种测试路由器的方法及系统
US9798608B2 (en) Recovery program using diagnostic results
CN111722997A (zh) 自动化测试的异常检测方法及计算机可读存储介质
CN111666200A (zh) 一种pc软件冷启动耗时的测试方法及终端
CN111382016A (zh) 测试终端与计算机的连接方法和装置
CN111400057A (zh) 一种远程控制测试进程的方法、装置和介质
CN110851309B (zh) 一种集成验证系统及方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16810738

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16810738

Country of ref document: EP

Kind code of ref document: A1