Wednesday, November 29, 2017

API Testing 01: What is a web service and what is an API?

In the real-world, applications talk (exchange data) with each other over the Internet using http protocol. This data exchange across different applications over the Internet is web service.

The applications can be developed in different technologies like Java, .Net, Php, Python and etc. but to communicate with each other or exchange the data, web services uses a common messaging system, like XML or JSON for data exchange.


There are two main components in a web services Client and Server.

The machine requesting for information is called Client and the machine providing the requested information as response is called Server. Typically Web Service is an object-oriented web based interface between client and server.

Application Program Interface (API)Technically an API – is set of functions or methods that are used in developing a product or service.

In other words – It is an application program that interacts with other applications internally or externally and retrieves required information.

Example 1: Consider POI API from Apache, we are using this in our project to read/write excel data.

Example 2: Consider java.util.File package, this is also an API. We are using this in our project for file I/O operations.

Example 3: In the similar way Selenium WebDriver is also an API that contains different methods to perform actions on the browser.

If you are booking a flight ticket on goibibo.com, you will be entering source, destination and date of travel and clicking on the search button. A program from goibibo.com takes all the user data and it will communicates with the different flight service servers like Air India, Air Asia, Indigo, Jet Airways and etc. and retrieves the corresponding  data and displays on the page Goibibo page. This program from goibibo.com side which is taking the user data is called an API.

Hope you this post gave basic understanding about Web Services and API. In the next post we will see what is API testing and what are the advantages of it. API Testing 02: What is API testing?

#HappyLearning #HappyTesting

1 comment:

  1. REST API is a set of functions helping developers in performing requests along with receiving responses. Through HTTP protocol interaction is made in REST API.

    Thanks for sharing such a valuable post and Keep Sharing !!!!
    API testing

    ReplyDelete

Selenium4: Working with two parallel windows in Selenium Automation

A new method newWindow() is introduced in Selenium 4 (Alpha). Using this method we can open a new tab or new window from the current window...