Hello All,
Try to put some information around Rest Assured API
testing using eClipse, TestNG. in subsequent blog, will provide some technical
view.
API testing using RestAssured
- RestAssured itself is API designed for automating Rest services/ Rest
APIs.
- Implemented using java classes
- Available in jar files
- Multiple request, get response from apis, validate
data etc
- Restassured only support Rest services, it not support SOAP services
Setting up
- Java
- Eclipse
- Test NG
- Maven (specify dependencies)
Steps:
- Create Maven project in eclipse
- Need to update POM.xml file
- RestAssured (https://mvnrepository.com/artifact/io.rest-assured/rest-assured/4.3.1)
- TestNG
(https://mvnrepository.com/artifact/org.testng/testng/7.3.0)
- JSON – simple
(https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple/1.1.1)
- Apache poi (https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml/4.1.2, https://mvnrepository.com/artifact/org.apache.poi/poi/4.1.2)
Validations:
Status Code
Status Line
Request body n parameters
Success code
Validate Header
Json contains
Print headers
Data driven testing
1 prepare test data in excel
2 add apache poi dependency in pom.xml or download apache poi & attach jars to
your build path
3 XL utility file(java class file) which will read
data from excel
4 write TestNG with data provider method
Cheers,
TJ
No comments:
Post a Comment