首页> 中文期刊>计算机与数字工程 >面向CLI的自动化测试方法的研究与实现

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

     

摘要

针对目前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 py-thon,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 Python's unittest module to write overall test-ing 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.

著录项

相似文献

  • 中文文献
  • 外文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号