Learn Selenium and Java for Selenium

Sunday, 15 July 2018

WebServices Test Automation-Introduction


What is WebServices?
WebServices are set of rules and protocols which helps in communication between two software on same or different platforms. For implementing these webservices there are two popular approaches:

REST:
REST stands for REpresentational State Transfer. This requires less bandwidth than SOAP. It allows all types of data formats  like plain text, HTML, XML, JSON etc
For example:
http://services.groupkt.com/country/get/all

SOAP:
SOAP stands for Simple Object access protocol. This requires more bandwidth than REST. It allows XML data format only.

Web services component?
Before moving to webservices testing, we should know about web services components.So have look at webservices components.

URL – Web service URL. Using this URL, we can send multiple requests to server.
For example:
http://services.groupkt.com/country/get/all

HTTP Method – GET, POST, DELETE etc.
GET: This method will fetch data from database and display to user.
POST: This method will enter new entry into the database
Delete: This method will Delete record from database.
PUT: This method will update any record from database

Header –  This will define what type of data we are passing.

Body Parameter – Here we pass actual data along with the request.

Response Code – After request has completed we will get response. There are specific codes are defined according to type of request has been made.For example:200,500 etc

What is Web Services testing?
Webservices can be tested by manually or by automation.First, We will see how to test  it manually. There are couple of tools are available for webservices testing.
SOAPUI, Postman etc.

You can download Postman from below :
https://www.getpostman.com/apps

You can install and open it.
PFB the sample screen shot for UI of Postman, where We need to hit the web services URL.I would be using above URL only.
Here, I am fetching data using GET method.





How can we Automate?
Manual testing for webservices is more tedious and time taking. There are couple of tools and frameworks are available for webservices  automation testing. SOAPUI, RestAssured, jersey-client, etc
In upcoming articles, we will see webservice automation testing using jersey-client.

0 comments:

Post a Comment

Popular Posts

Recent Posts



Newsletter

Join our newsletter to get secret tips directly in your inbox!


*We Hate Spam!

Powered by Blogger.