摘要
研究了HTTP接口自动化测试方法,采用Python语言开发代码,使用Request调用HTTP接口。提出了一种分层结构的自动化测试框架,将接口调用、测试用例和测试数据的代码分层开发,生成基于HTML的测试报告。提出了两种解决CSRF Token验证问题的方案。该方法开发出的自动化测试脚本具有结构清晰、易维护等优点,能够有效提高测试效率,降低测试成本。
An automatic testing metliod for HTTP interface was investigated. It used Pytlion to develop codes and usedTP Interface. A hierarchical framework for automatic testing was proposed. In this framework,the codes of interface called,test cases and testdata were developed separately. It generated test report based on HTML. In this paper,two solutions for the problem of CSRF Token verifica-tion were proposed. The automatic testing scripts developed with this method had the advantages of clear structure and easy to maintain. It could effectively improve the efficiency of testing and reduce the cost of testing.
出处
《微型机与应用》
2016年第18期22-25,共4页
Microcomputer & Its Applications
基金
国家高技术研究发展计划(863计划)(2014AA123001)