API Testingforinterview9
API Testingforinterview9
An API is Application programming Interface that enables two Application to communicate Each
other i.e. Client and server.
API is one type of security which provide security to data which is interacting between Client and
server.
API means sending request and getting response from server in different format.
Client:-
A client is computer hardware device that access a service which available by the server.
Server:-
Text
XML
JSON (java script object notation)
HTML
Example of API:-
Calculator API
Selenium API
Web services:-
Web service is nothing but sending request and getting response from server Over a network (http
or https).
All web services are API but All API are not web services.
Web services is an API Wrapped in http or https.
A web service need a network to send request and getting response and API doesn’t need network
to send request and getting response.
Tool used:-
1. Postman
2. SOAP UI
3. Swagger.
What is REST:-
REST (Representational state Transfer) it is an Architecture Style for developing web services that
uses http Protocol for transferring request and getting response.
SOAP :-
XML, JSON,HTML,TEXT.
Practice site :-
https://reqres.in/
https://gorest.co.in/
http://dummy.restapiexample.com/#
Click on NEW
CRUD operation:-
https://gorest.co.in/public/v2/users
Path Parameter:-
Ex :- https://gorest.co.in/public/v2/users
Query Parameter:-
Ex - https://gorest.co.in/public/v2/users?page=1
Headers:-
Key value
Authentication :- key
Value :-
Username/Password
Auth key
Token – Bearer+ space+ token value
No Auth
While doing API testing we have to check Status code , Response time , data .
2XX – Success
200 – Ok
We found this status code when we are using post method and creating some new entity successfully in
DB/server.
401 – Unauthorized
We found this status code when we are passing wrong token key .
Occur when we are trying to fetch data which is not available in DB /server.
API Advantages:-
Rest Assured: -
If we want to automate any API then we Required Rest Assured Libraires.
RESFUL: -
WSDL
UDDI:
- universal description discovery integration
-UDDI is an XML based standard for describing, publishing and finding the webservices
WSDL elements:
a. Type- Define the data types used by the webservices
b. Message – Define the data element for each operation
c. Port Type- Describe the operation that can be performed and message involve
d. Binding- Defines the protocol and data format for each port type
Ans: Error or status code , response time and data which is coming from server.
https://gorest.co.in/
http://dummy.restapiexample.com/#