TA的每日心情 | 慵懒 2019-2-2 13:49 |
---|
签到天数: 242 天 连续签到: 1 天 [LV.8]测试军长
|
原文作者:Grigor Avagyan
作者联系方式:无
原文地址链接:https://www.blazemeter.com
推荐理由:可以学会如何提取API测试的值
The ability to extract values and use them in the following subsequent request is an important ability in modern API Testing solutions. In this blog post I will show you how to extract and assert these values, by using Java, Gradle, Intellij and REST Assured.
Intellij is an integrated development environment, REST Assured is an open-source framework for testing REST services in Java, and Gradle is a Build tool. You can choose different tools for this kind of testing. It all depends on your preferences and taste, and of course which kind of project you are testing.
For demo testing, I created a small API with Java / Spring Boot and Hibernate. The API has 4 Controllers - Arrival, Departure, Users and Flight. Each of them has 2 or more endpoints/paths for calling by different types of request. Most of them are GET, but there are also POST and DELETE requests in some paths. You can run this test yourself, from here.
The testing shown here will cover all simple areas for endpoints testing, e.g. schema validation of JSON response, request time, allowed methods and etc. Unit testing is not included.
Step 1 - Create a API Testing Project
1. Install IntelliJ IDEA
2. Make sure you have JDK installed (at least version 1.8.XXX).
Now we will create a new project.
3. Open IntelliJ and click “Create New Project”
......
(下载附件即可查看原文)
【申请翻译方式】
① 发送一段试译内容到我们的邮箱 editor@51testing.com,通过后即可翻译
② 加小编 QQ:1718403480,备注:翻译试译
【翻译奖励】
① 翻译文章经过评审入选后,即可发布在《51测试天地》电子刊物中,并有相应稿费支付!还有机会上网站头条,得到大力宣传!
② 未入选文章,也可以获得博为峰网校10元代金券
如果你想锻炼自己的翻译能力,或者想学习最新最热的技术内容,欢迎加入到我们的翻译队伍中来!!
|
|