CODE API BODY
NA
GET https://reqres.in/api/user?page2
NA
GET https://reqres.in/api/user/2
{
"name"= "ShivaKamesh",
"Job"="Leader"
POST https://reqres.in/api/user }
{
"email":
"eve.holt@reqres.in",
"password": "cityslicka"
POST https://reqres.in/api/login }
{
"email":"peter@klaven"
}
POST https://reqres.in/api/login
GET https://dummy.restapiexample.com/api/v1/employees
GET https://dummy.restapiexample.com/api/v1/employee/1
{
"name": "Anil",
"Job":"QA Engineeer",
"Age": "20",
"salary":"65000"
}
POST https://dummy.restapiexample.com/api/v1/create
{
"name": "Anil",
"salary": 950500,
"age": 32
}
PUT https://dummy.restapiexample.com/api/v1/update/21
https://dummy.restapiexample.com/api/v1/delete/2
DELETE
SUCCESS RESPONSE Failure Response Status code
Return all users in page NA
200
Return Single user NA
200
{ NA
"name": "ShivaKamesh",
"Job": "Leader",
"id": "552",
"createdAt": "2022-10- 200
12T09:18:55.044Z"
}
{ NA
"token": "QpwL5tke4Pnpja7X4"
}
201
{ NA
"error": "Missing password"
}
400
{
"status": "success",
"data": {
"id": 1,
"employee_name": "Tiger
Nixon",
"employee_salary": 320800,
"employee_age": 61,
"profile_image": ""
}, 200
"message": "Successfully!
Record has been fetched."
}
{
"status": "success",
"data": {
"name": "Anil",
"Job": "QA Engineeer",
"Age": "20",
"salary": "65000",
"id": 3202
}, 200
"message": "Successfully!
Record has been added."
}
{
"status": "success",
"data": {
"name": "Anil",
"salary": 950500,
"age": 32
}, 200
"message": "Successfully!
Record has been updated."
}
{
"status": "success",
"data": "20",
"message": "Successfully! 200
Record has been deleted"
}
validation
tests["validatio code"] = responseCode.code == 200;
tests["validating response body"] = responseBody.has("data");
var response = JSON.parse(responseBody);
tests["page no"] = response.page == 5;
tests["page no"] = response.total == 12;
tests["validating response body"] = responseBody.has("Janet");
tests["validating response body"] = responseBody.has("weaver");
--------------------OR-------------------------------------------
var response = JSON.parse(responseBody);
tests["response first name"] = response.data.first_name == "Janet";
tests["response last name"] = response.data.last_name == "Weaver";
var response = JSON.parse(responseBody);
tests["response first name"] = response.data.first_name == "Janet";
tests["response last name"] = response.data.last_name == "Weaver";
tests["validating Token Check"] = responseBody.has("token");
var response = JSON.parse(responseBody);
tests["response first name"] = response.data.first_name == "Janet";
tests["response last name"] = response.data.last_name == "Weaver";