Wednesday, November 29, 2017

API Testing 01: What is a Web Service and what is an API?

What is a Web Service ?

Web Service is a service offered by an electronic device to another electronic device for communicating with each other via World Wide Web (Internet). And for communicating with each other web technology like HTTP protocol is utilized.


These devices exchange data in the machine readable formats like XML or JSON. 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.

What is an API?

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

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.

Generally an API – is an application program that interacts with other applications over the internet and retrieves required information.

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.

In a nut shell, APIs are application programs that help us in building a service or product. And whatever is happening between one or more devices through APIs over the internet is called a Web Service.

What is API Testing?

In API testing an API will be invoked with URL and set of parameters and result/response will be validated against expected behavior.


The advantages are:

  • Faster tests
  • Testing core functionality
  • Improved quality
  • Reduced defects
There are many tools available for API Testing, few are listed below:
  • Postman - Manual, Automation
  • SOAP UI - Automation
  • REST-assured - Automation
  • Katalon Studio - Automation
  • Jmeter - Automation

In this series of blogs we will learn API Testing using REST-assured.It is a powerful Java API for testing the REST APIs. We will discuss more about REST-assured in the upcoming posts.

Hope this post gave you basic understanding about what is a Web Services, API and 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

Katalon 08: Integration of HP ALM with Katalon Studio

In this post, this post we discuss about integration of  HP ALM with Katalon Studio. If we can integrate HP ALM with Katalon we can update ...