Wednesday, September 11, 2019

API


  • API
Application Program Interface
API is an messenger

take the request, what you want to do
take the response back to you

e.g.  end user<->search airflghts from travel agent< - > air line company


  • API types

API : methods (parameters)
between software, operation system and harware
API (local)
Web API, web services(Web)


  • Web API / Web Serivices 
Services on Web for apps  (no UI)
myapp
---> Google service, Facebook services, Twitter services  (api)
many apis are available to use


  • API protocol -- extrange data between applications
Formatted structure of request and response, HTTP

Soap is a protocol, simple object access protocol.
Two major fuctions GET and POST
invoke calling by RPC method
XML used as data format on the request and the response side. The amount of data transferred within the SOAP structure was enormous, thus requiring more resources and slowing down the communication.
difficult to call from javascript
Strong data typing
Safe

REST is an architectural style, Representational State Transfer
over HTTP only
call services via make request to URL
GET, POST, PUT,DELETE
request simple. return all properties, server defines which data is to be returned,
use XML or JSON to send or receive data
Easy to call from javascript
Weak data typing
REST + JSON



URL Uniform Resource Locator 

  • WEB API life cycle:

design and mock -> debug -> Automation Testing ->document->monitor->publish


  • API testing




No GUI, test business logic
Test Tool to drive test
Write test scripts
  • Types of Bugs that API testing detects
Fails to handle error conditions gracefully
    Unused flags
      Missing or duplicate functionality
        Reliability Issues. Difficulty in connecting and getting a response from API.
          Security Issues
            Multi-threading issues
              Performance Issues. API response time is very high.
                Improper errors/warning to a caller
                  Incorrect handling of valid argument values
                    Response Data is not structured correctly (JSON or XML)


                    No comments:

                    Post a Comment

                    API interview questions

                      https://www.katalon.com/resources-center/blog/web-api-testing-interview-questions/ Top 50+ Web API Testing Interview Questions [Ultimate l...