Katalon Studio

How to Perform API Testing using Katalon Studio

In this article, I will cover how to perform API Testing using Katalon Studio and how to assert the various responses.

API Testing- New version of Katalon support API testing (SOAP and RestFul both) and they also provided very easy UI which will help testers to automate API’s without using much coding knowledge as well.

In one of my previous article, we already discussed how to download and use Katalon Studio for Web Automation so if you have not checked yet then I will suggest you go through the first post for Web UI automation.

API Testing using Katalon Studio

Quick notes before we start the post.

If you have not download Katalon then first go and download the new version of Katalon 5.4.2 Link to Download

I will be using sample application for API Testing

http://jsonplaceholder.typicode.com/

http://jsonplaceholder.typicode.com/posts

How to perform Get Operation in Katalon Studio

 

How to Post and Delete Operation in Katalon Studio

Introduction to Katalon Analytics

Step 1- Create a new project in Katalon Studio

API Testing using Katalon Studio

 

2- Provide a meaningful name to your project

 

3- Create a new web service request

 

4- Katalon support SOAP and Rest both, so in this article, we are using only Rest API.

4-Select Restful

 

5- Create an Object type

Enter the URL of the API which you want to test and click on run button. It will take few seconds and will provide result in right panel which will have status, size and time taken by the server to respond.

You can also view the result in different forms like raw type and so on.

5- Send Get Response

 

6-  Create Test Case

Testcase is series of steps which you want to perform. A single test case can have multiple steps and multiple validations depends on requirement.

6-Create new test case

 

7- Give name and ok

7- Create steps for testing

Katalon already added many keywords which will help you perform different steps and validation. We are using a couple of keywords like SendRequest and VerifyResponseCode keywords.

Here is the list of keywords and documentation of API testing keywords for Katalon

We are using SendRequest keyword which accepts Test Object (VerifyGet) and output (optional) which will store the result.

9- Select Send Request

Select Object type and click on ok button.

10- Select Test Object

Kindly provide the variable name (myresp in our case) which we will use for validation.

11- Name of response Data

Let’s add another keyword Verify Response Status code keyword which will validate the response code.

12- Add statement for response code verification

Get the response variable and provide input as the response variable and expected the result. If response code will match then it will pass the test else failed.

13- Add assertion and click on OK Button

 

8- Run the test and analyze the result

 

 

 

 

Hope you have like above article. If yes then please share this post with your friends as well.

See you in the next article 🙂 Have a nice day.

author-avatar

About Mukesh Otwani

I am Mukesh Otwani working professional in a beautiful city Bangalore India. I completed by BE from RGPV university Bhopal. I have passion towards automation testing since couple of years I started with Selenium then I got chance to work with other tools like Maven, Ant, Git, GitHub, Jenkins, Sikuli, Selenium Builder etc.

2 thoughts on “How to Perform API Testing using Katalon Studio

  1. Raj says:

    While doing POST methods in RESTful API, the JSESSIONID gets changed for different POST methods. Only I could success message for the first POST method and for rest of the POST methods it gets failed.

    1. Hi Raj,

      Please check whether you are able to do POST call with same payload or different payload.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.