API Test using katalon

Andria Sufy
Life at Telkomsel
Published in
4 min readJun 19, 2024

API or Application Programming interface is a set of rules or protocols that enables software applications to communicate with each other to exchange data, features and functionality.

API tests focus on the functionality and integration of backend services, are faster to execute, and are independent of the frontend UI meanwhile UI tests focus on the user interface, simulate user interactions, and ensure that the application meets user expectations but are slower and more dependent on the UI’s stability. In practice, both API tests and UI tests are important for ensuring the overall quality of a software application, with each type providing valuable insights into different aspects of its functionality and usability. However, UI test must be in priority for the tester to test as method for E2E test.

So here some test cases for api test:

  1. To validate status code
  2. To validate error handling and message code
  3. To validate he body or http body respons
  4. To validate response time

In this article, there are 3 steps into basic api tester:

  1. Create and run testcase
  2. Create and run test suite
  3. Reporting

Lets begin the journey to create and run testcase for API Test by using Katalon Studio:

  1. You should install katalon Studio free in your local machine. Here’s the url for downloading: https://katalon.com/download .
  2. After the Katalon has been installed in your local machine, then login first (if you are already registerd, if not, please registered first).
  3. If the Katalon already opened, you should make the new project locally, so here’s how it looks:
preview of ‘new project’

4. Set type Name of project -> Chose type API web service -> chose project as ‘Blank’ -> dont forget to set location as you wish -> ok

It will preview like this:

preview of API project

After you finally create new project of API service, now you can try to test some API. In this article, i used free example API from internet, here is the source of free API example: https://dev.to/ritaly/the-simplest-guide-to-curl-for-rest-api-requests-35ii .
Thus, the fist step to test api, you should create new object repository. Here’s the step:
1. Right click on your mouse at object repository.

preview of ‘object repository’

2. Object repository -> new -> web service request -> input name -> chose restful(if you are using rest API) -> ok

preview of ‘web service request of restful’

Now, we can create our api first, i used api method get. input url in field and chose te method ‘GET’ the url: https://api.restful-api.dev/objects then click run button. it should preview just like at the picture below:

preview succes api method GET

Lets create our testcase then, create ‘test case’

3. Test Cases -> New -> Test Case -> input name -> ok

preview create ‘new test case’

4. Add web service keyword -> send request -> click object -> chose test object on repository -> click ok -> type output ‘request’

To verify our response code ‘200’ as request we should add more step. in here, i chose “verify response code” keyword

5. Add web service keyword -> verify response code -> input response object ‘request’ -> type value status code ‘200’ -> ok

preview of input ‘verify response code’

6. Run the testcase

preview succes testcase

After you finally understand to test api by run testcase, now i will show you how to run test suite and generate the report.

Now, second step, to create and run test suite. here’s the tutorial:

  1. Test suite -> new -> test suite
create new test suite

2. Add -> testcase browser -> chose testcases

chose testcases for test suite

3. Ok -> run test suite

success Test suite execution

Last step, reporting. To open report you should get through run test suite first. after successfull running test suite, now you can open the report. here’s the step you shoud follow:

Local document that you saved katalon project-> Reports -> file Test suites → chose HTML report

report Test suite in local machine

If you are reading in this paragraph, now you are succesfull finished reading and try this turorial for API Test.

Congratulation! try to explore more insights and techniques to effectively validate APIs accross various use case. If you have any more questions or need further clarification on any specific aspect of API testing, feel free to ask and happy testing!

--

--