Katalon WireMock Integration: Mock APIs for Reliable Testing

katalon wiremock integration

Katalon Studio integrates with WireMock Cloud so you can mock APIs that aren't ready or are unstable, simulate errors and edge cases, and share virtual services across teams. Here's how to set it up step by step.

Key takeaways
The 30-second version of this article
WireMock Cloud lets Katalon users mock APIs that aren't built yet or are unstable, reducing test flakiness.
Mocks make it easy to simulate error codes, faults, and edge cases for unhappy-path testing.
You can create mocks manually, from OpenAPI specs, or by recording traffic to a real API.
In Katalon Studio, point a web service request at the mock URL and verify responses with WS keywords.

Katalon Studio integrates with WireMock, a leading provider of mocking services that delivers both an open source version as well as a cloud version.    
With WireMock Cloud, Katalon users will be able to easily mimic a production API’s behavior for end to end testing even if the production API is not yet developed or available. These virtualized services (aka service virtualization) can then be shared and used across teams without additional effort or maintenance.

Why is service virtualization so important for Katalon users?

Virtualizing a service enables Katalon users:

  • to build test assets even when the APIs you need aren’t ready or released.
  • to guard against unstable 3rd party API’s when developing tests to reduce test flakiness
  • to simulate edge cases and faults easily, to help with unhappy path testing.

Real World Example

Consider there is a Banking application that contains thousands of APIs that take inputs from a web page (Customer details, Fund details, Interest calculations, etc.). This application communicates to external services (endpoints -> SOAP/REST) and it is not the tester’s responsibility to worry about getting the test data for testing & having to wait for these environments. However, APIs designed need to be tested against a set of data (Customer details, fund details, etc.). There is a need to remove this external Network Call (dependency) and create something at the run time and simulate the network calls.

A network call can return different status codes 404, 500, 200, 303, etc with a JSON response. The application has to work for all such scenarios along with a different set of data for 200 responses. Standing up real back-end services and databases just to test every one of these scenarios is slow and hard to maintain.

That is where Mocking services come into picture.

How to Integrate Katalon with WireMock Cloud 

To integrate Katalon Studio with WireMock Cloud, follow these steps:

  1. Create a WireMock Cloud account. WireMock Cloud offers a free edition as well as paid plans for enterprises.
  2. Create a mock API in WireMock Cloud and add stubs for the responses you need.
  3. In Katalon Studio, create a web service request that points to your mock API's URL, and send it from your test script with WS.sendRequest().
  4. Verify the response using Katalon's API verification keywords to check the status code, headers, and response body.

The walkthrough below shows these steps in more detail.

Step 1: Create a mock API service in WireMock Cloud and review its settings.

Step 2: Pick the real API you want to mock (in this example, a sample public API).

Step 3: There are various ways to create a mock service in WireMock Cloud  

  • Manually via the web UI  
  • Swagger or OpenAPI specification import  
  • Record traffic to and from another API  
  • Import an existing project from WireMock  
  • Automate via the REST API or WireMock  

You can use recording to create sample stubs within the mock service you created in WireMock Cloud. You can also watch a 90-second video that shows how.

Step 4: Once the real API service is recorded you can observe that multiple stubs are created with all the responses captured during the recording.

Wiremock Step 4
 
 

Step 5: Once recorded, head over to Katalon Studio, create a new web service request, and point it at the mock API service recorded in WireMock Cloud.

Step 6: We now run the sample request and observe that the responses are from the MockAPI vs the real API service.

Wiremock Step 6

Step 7: We can now create an API test within Katalon and compare using verification and validation mechanism

Salesforce Katalon Screenshot 7

Here's a minimal Groovy example of calling a WireMock Cloud mock from a Katalon test case and verifying the mocked response. Point the request's URL in your Object Repository at your mock API's base URL:

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

// Send the request defined in the Object Repository (its URL points to WireMock Cloud)
def response = WS.sendRequest(findTestObject('Object Repository/WireMock/GetCustomer'))

// Verify the mocked response
WS.verifyResponseStatusCode(response, 200)
WS.verifyElementPropertyValue(response, 'name', 'Jane Doe')

This is just an example to show how Katalon Studio works with WireMock Cloud. Adjust the request, stubs, and assertions to fit your own testing requirements.

Frequently asked questions

Son Huynh
Son HuynhSupport Engineer

Son Huynh is a Support Engineer at Katalon, based in Ho Chi Minh City, where he helps customers solve technical issues across the Katalon platform. Before joining Katalon in 2025, he spent three years as a Professional Services Engineer at ELCA Vietnam. He studied at California State Polytechnic University, Pomona.

Connect on LinkedIn →
Get started

Test everything. Ship with confidence.

From generating test cases to spotting failures, Katalon's AI works across your entire pipeline, automatically.

Live webinar

The Next Evolution of Manual Testing: Introducing Katalon AI Test Runner

Learn how to grow your QA team's capacity in the age of AI, then watch Katalon AI Test Runner turn manual test cases into automated runs, live.

2:00 to 3:00 PM IST
Almas AhmedSenior Account Manager
Sumit WankhedeSolutions Engineer Manager
Register now