面向CLI的自动化测试方法的研究与实现  

Research and Implementation of CLI-Oriented Automation Testing Method

在线阅读下载全文

作  者:徐彩霞 葛华勇[1] 侯仰宇 

机构地区:[1]东华大学信息科学与技术学院,上海201620

出  处:《计算机与数字工程》2018年第2期332-336,共5页Computer & Digital Engineering

摘  要:针对目前CLI(Command-line Interface,命令行界面)手工测试的繁琐性和易错性,以及录制生成脚本测试方法中存在的脚本维护问题,论文运用Python研究并实现了一种CLI自动化测试方法。该方法采用数据驱动脚本的形式,将测试数据从测试脚本中分离出来并存放在可读性高的yaml数据文件中,而且使用Python的unittest模块编写整体测试框架。该框架利用telnet协议远程登录主机,并将yaml文件中的测试数据作为参数载入到测试脚本中,然后运行测试数据,将测试结果输出到系统界面和日志中。测试结果表明,该方法有效地避免了CLI手工测试的出错频率,减少了测试脚本的维护量,提高了测试脚本的复用度。This paper researches and implements a CLI(Command-line Interface)automation testing method using the python,which is aimed at complexity and fallibility of the CLI manual testing method,and script maintenance problems existing in the recording and generating script testing method now. The method adopts the form of data-driven script to separate the test data from the test script and store it in a highly readable yaml data file. Besides,the method uses Pythons unittest module to write overall testing framework. The framework uses telnet protocol to remote login host,and loads the test data in the yaml file as a parameter into the test script. Then running the test data,and exporting test results to the system interface and the log. The testing results indicate that this method can avoid the error frequency of CLI manual testing effectively,reduce maintenance and enhance reusability of test script.

关 键 词:CLI自动化测试 数据驱动脚本 TELNET协议 unittest模块 yaml文件 

分 类 号:TP273[自动化与计算机技术—检测技术与自动化装置]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象