You are on page 1of 52

API Testing

SOAPUI Tool-

SOAP service-

Developer will provide- In Mail (Unit Testing doc + )

1. WSDL File/ URL/URI - http://www.dneonline.com/calculator.asmx?wsdl


2. Payload/ Body
3. Time taken for response
4. Authorization/ User name & Password

Service- http://www.dneonline.com/calculator.asmx?wsdl
Request  Web side/ server (Functionality used work)
Service  Integer data type only add, sub, multiple, Divide
1. Validating SOAP/Rest response=Pass
2. Validating Data and count of data in response=Pass

3. Validating Tagname/Attributes presents in responses= AddResult Tagname should be present =pass


4. Validating Status code in responses=200-ok=Pass

5. Validating Time taken for responses


6. Applying Assertion for verification
7. Validating the Functionality
7.1 Validating the add two integer no. of single digits--> Two integer no. will be add=Pass

7.2 Validating the add two integer no. of two digits--> Two integer no. will be add

7.3 Validating the add two integer no. of three digits--> Two integer no. will be add

7.4 Validating the add two integer no. ten digits--> Two integer no. will be add

8. Validating NEGATIVE test cases !


8.1 Validating the add functionality by passing charter--> Charter no. should not be added=Pass

8.2 Validating the add functionality by passing Decimal--> Deciaml no. should not be added
8.3 Validating the add functionality by passing Special charter--> Charter no. should not be added

8.4 Validating the add functionality by passing cobimantion of one no. is interger 7 another no.
charter--> Charter no. should not be added

8.5 Validating the add functionality by passing blank no  values should not be added

REST Service-
GET Method-
Developer will provide- In Mail (Unit Testing doc + )

1. WSDL File/ URL/URI – https://reqres.in/api/users?page=2


2. Payload/ Body
3. Time taken for response
4. Authorization/ User name & Password

Service- https://reqres.in/api/users?page=2
Service  Service 2/ Server 2 employee’s data present display
1. Validating Rest response=Pass
2. Validating Data and count of data in response

3. Validating Tagname/Attributes presents in responses


4. Validating Status code in responses

5. Validating Time taken for responses


6. Applying Assertion for verification
7. Validating the Functionality

7.1 Verify the total records present in service 2


7.2 Verify the total records present in service 2 per page =1

7.3 Verify the total records present in service 2 per page=2


7.4 Verify the total records present in service 2 per page=3

7.5 Verify the total records present in service 2 per page=4


8. Validating NEGATIVE test cases !

8.1 Verify by passing by wrong URI/Endpoint/Domain name= 404- Not found

8.2 Verify by passing by wrong Resource = 404- Not found


8.3 Verify by passing by wrong Parameter = 400-Bad Request= But 200-ok= Fail Defects

8.4 Verify by passing by changing GET Method to DELETE Method= 405 –Method not allocated
204 –No contact = Defects
POST Method- https://reqres.in/api/users
Developer will provide- In Mail (Unit Testing doc + )

1. WSDL File/ URL/URI – https://reqres.in/api/users


2. Payload/ Body –
{
"name": "morpheus",
"job": "leader"
}

3. Time taken for response


4. Authorization/ User name & Password

Service- https://reqres.in/api/users
Service  Service create a job profile for a user. (Name, Job, ID, Created)
1. Validating Rest response
2. Validating Data and count of data in response=Pass
3. Validating Tagname/Attributes presents in responses  Name, ID, Job, CraetedAt=Pass

4. Validating different Status code in responses 201- created=Pass


5. Validating Time taken for responses=Pass

6. Applying Assertion for verification

7. Validating the Functionality

7.1 Verify that Name=ABC, JOB=API Tester in POST request 201-created =Pass
7.2 Verify that Name=XYZ, JOB=MANAUL Tester in POST request 201-Created=pass

7.3 Verify that Name=PQR, JOB=DATABASE Tester in POST request 201 –created=Pass
7.4 Verify that Name=JKL, JOB=AUTOMATION Tester in POST request 201-created=pass

8. Validating NEGATIVE test cases !

8.1 Verify that Name=Blank, JOB=API Tester in POST request400-Bad request=Fail


8.2 Verify that Name=ABC, JOB=Blank in POST request400-Bad request=Pass

8.3 Verify that Name=Blank, JOB= Blank in POST request400-Bad request=Fail


8.4 Verify that by passing integer values in Name, JOB field in POST request400-bad request=Fail

8.5 Verify that by passing wrong URI in POST request 404-Not found=Fail
8.6 Verify that by passing wrong resource in POST request 404-Not found=Pass

8.7 Verify that by passing wrong Payload/ Body in POST request  400-Bad request=Pass
PUT Method-
Developer will provide- In Mail (Unit Testing doc + )

1. WSDL File/ URL/URI – https://reqres.in/api/users/2


2. Payload/ Body –

{
"name": "morpheus",
"job": "zion resident"
}

3. Time taken for response


4. Authorization/ User name & Password

Service- https://reqres.in/api/users/2
Service  Service creates a job profile for a user. (Name, Job, Created)

1. Validating Rest response=Pass


2. Validating Data and count of data in response=Pass

3. Validating Tagname/Attributes presents in responses=Pass


4. Validating different Status code in responses 202- Accepted= Fail Defects

5. Validating Time taken for responses=Pass


6. Applying Assertion for verification
7. Validating the Functionality

7.1 Verify in PUT request by passing Valid Name=ABC & Valid Job=API TESTER
7.2 Verify in PUT request by passing Valid Name=ABC & Valid Job=AUTOMATION TESTER
7.3 Verify in PUT request by passing Valid Name=ABC & Valid Job=DATABASE TESTER
7.4 Verify in PUT request by passing Valid Name=ABC & Valid Job=MANUAL TESTER

8. Validating NEGATIVE test cases !

8.1 Validate in PUT request by passing InValid Name=ABC & Valid Job=API TESTER
8.2 Validate in PUT request by passing Valid Name=ABC & InValid Job=API TESTER
8.3 Validate in PUT request by passing InValid Name=ABC & InValid Job=API TESTER
8.4 Validate in PUT request by passing blank Name=ABC & blank Job=API TESTER
8.5 Validate in PUT request by passing integer values in Name=ABC & integer values Job=API TESTER
8.6 Validate by passing wrong URI
8.7 Validate by passing wrong resource
8.8 Validate by passing wrong Payload/ Body
8.9 Validating by wrong Username & password
POSTMAN Tool-
 POSTAMN tool used for only Rest services

GET Method/request-
Developer will provide- In Mail (Unit Testing doc + )

1. URL/URI – https://reqres.in/api/users?page=2
2. Payload/ Body
3. Time taken for response
4. Authorization/ User name & Password

Service- https://reqres.in/api/users?page=2
Service  Service 2/ Server 2 employee’s data present display

POSTMAN Tool some of pre-request condition-

1. Authorization/ Username or password


2. Header (Content-type, Accept)
3. Payload/Body (POST,PUT,PATCH)
1. Validating Rest response
2. Validating Data and count of data in response

3. Validating Tagname/Attributes presents in responses


4. Validating different Status code in responses

5. Validating Time taken for responses

6. Applying Assertion for verification

7. Validating the Functionality

7.2 Verify the total records present in service 2 per page =1


7.3 Verify the total records present in service 2 per page=2

7.4 Verify the total records present in service 2 per page=3

7.5 Verify the total records present in service 2 per page=4

8. Validating NEGATIVE test cases !

8.1 Verify by passing by wrong URI/Endpoint/Domain name= 404- Not foundFail - Defects
8.2 Verify by passing by wrong Resource = 404- Not found=Pass

8.3 Verify by passing by wrong Parameter - 400-Bad Request= Fail- defect


8.4 Verify by passing by changing GET Method to DELETE Method- 405 –Method not allocated= Fail

8.5 Verify by passing wrong authorized - 401- Unauthorized =

POST Method- https://reqres.in/api/users


Developer will provide- In Mail (Unit Testing doc + )

5. WSDL File/ URL/URI – https://reqres.in/api/users


6. Payload/ Body –
{
"name": "morpheus",
"job": "leader"
}

7. Time taken for response


8. Authorization/ User name & Password

Service- https://reqres.in/api/users
Service  Service create a job profile for a user. (Name, Job, ID, Created)
9. Validating Rest response
10. Validating Data and count of data in response=Pass

11. Validating Tagname/Attributes presents in responses  Name, ID, Job, CraetedAt=Pass


12. Validating different Status code in responses 201- created=Pass

13. Validating Time taken for responses=Pass

14. Applying Assertion for verification

15. Validating the Functionality


15.1 Verify that Name=ABC, JOB=API Tester in POST request 201-created =Pass
15.2 Verify that Name=XYZ, JOB=MANAUL Tester in POST request 201-Created=pass

15.3 Verify that Name=PQR, JOB=DATABASE Tester in POST request 201 –created=Pass
15.4 Verify that Name=JKL, JOB=AUTOMATION Tester in POST request 201-created=pass

16. Validating NEGATIVE test cases !

16.1 Verify that Name=Blank, JOB=API Tester in POST request400-Bad request=Fail

16.2 Verify that Name=ABC, JOB=Blank in POST request400-Bad request=Pass


16.3 Verify that Name=Blank, JOB= Blank in POST request400-Bad request=Fail

16.4 Verify that by passing integer values in Name, JOB field in POST request400-bad
request=Fail

16.5 Verify that by passing wrong URI in POST request 404-Not found=Fail

16.6 Verify that by passing wrong resource in POST request 404-Not found=Pass

16.7 Verify that by passing wrong Payload/ Body in POST request  400-Bad request=Pass

PUT Method-
Developer will provide- In Mail (Unit Testing doc + )

1. WSDL File/ URL/URI – https://reqres.in/api/users/2


2. Payload/ Body –

{
"name": "morpheus",
"job": "zion resident"
}

3. Time taken for response


4. Authorization/ User name & Password

Service- https://reqres.in/api/users/2
Service  Service creates a job profile for a user. (Name, Job, Created)
Real API Test-

https://home.openweathermap.org/myservices

1. Validating SOAP/Rest response

2. Validating Data and count of data in response

3. Validating Tagname/Attributes presents in responses

4. Validating different Status code in responses

5. Validating Time taken for responses

6. Applying Assertion for verification


7. Validating the Functionality of API

7.1 Verify by passing city name=pune


7.2 Verify by passing city name=Mumabi
7.3 Verify by passing city name=Nashik
7.4 Verify by passing city name=Abad
7.5 Verify by passing city name=Nagpur
7.6 Verify by passing city name=XYZ

8. Validating NEGATIVE test cases !

8.1 Verify API by passing invalid city name = vctc  400-Bad request
8.2 Verify API by passing invalid username & Bareie key  401-Unathorized
8.3 Verify API by passing invalid URL = vctc  404- Not found
8.4 Verify API by passing service which is not accessible to VCTC 405- Method not allowed
8.5 Verify API by stop API  500- Internal server error
Collection-

You might also like