Welcome to our comprehensive guide on mastering API testing with Katalon Studio and JMeter integration. Whether you’re a seasoned tester looking to expand your skill set or a beginner eager to learn the ropes, this blog will serve as your roadmap to creating, executing, and validating API requests seamlessly.
We’ll walk you through the entire process, from setting up proxies in Katalon Studio to recording and executing tests in JMeter. By the end of this journey, you’ll have the knowledge and tools to confidently navigate the world of API testing, ensuring your applications perform flawlessly in today’s interconnected digital ecosystem. Let’s dive in!
Create API requests in Katalon Studio
We will create some REST API requests in Katalon Studio. We have created some sample REST API requests. Below is the snapshot of the API requests that we will use:
You can refer to my article below to learn how to create API requests in Katalon Studio
A Comprehensive Guide to Request-Response Chaining of REST API in Katalon Studio (JSON)
Setting Proxy in Katalon Studio
We can set a proxy in Katalon Studio in two ways – Manual proxy configuration in Katalon Studio and Use System Proxy. Following are the steps for each method:
Manual proxy Configuration in Katalon Studio
- Open Katalon Studio > Windows > Katalon Preferences > Katalon > Proxy > System
- Select “Manual Proxy Configuration” in the Proxy option, set Address as “localhost” and Port to 8080 (as per your preference) > Apply and close
Using System Proxy (Windows system)
- Settings > Network > Proxy > Enable Manual Proxy
- Set Address as “localhost” and Port 8080 > Save
- Open Katalon Studio > Windows > Katalon Preferences > Katalon > Proxy > System
- Select “Use System Proxy Configuration” in the Proxy option.
Now that we have completed the Proxy configuration, we can use either of the methods as suitable.
Creating Test in JMeter
We will create a test for our API request testing. We will create a test plan using JMeter’s “Recording” template. The template contains an https test script recorder and recording controller, which will be helpful for us. Set host to “localhost” and schemeToRecord as “https,” as we are using the “https” protocol in our REST API requests.
Lastly, in the HTTP(S) Test Script Recorder, set Port to 8080 (same as in our Proxy).
Executing the Test
Follow the below steps to run the API request from Katalon Studio and record it in JMeter.
- In the test in JMeter > HTTP(S) Test Script Recorder > Click “Start” button
- Open Katalon Studio > Run all API requests we created
- Stop the JMeter recorder
- All our requests are now recorded and saved under the Recording controller in JMeter.
- Drag and drop the requests under Thread Group and disable the Recording controller.
- Now, we can add the number of threads and listeners for the result
- Save and Run the Test.
Similarly, we can easily create API requests in Katalon Studio and record them in JMeter.
We can record API Requests from Katalon Studio for JMeter as JMeter is a performance tool with few functionalities for API testing, like generating API requests using a WSDL file.
Conclusion
In conclusion, this journey of API testing through creating and executing API requests in Katalon Studio, integrated with JMeter, equips testers with a powerful and versatile approach. By addressing the limitations of JMeter in API testing and leveraging Katalon Studio’s capabilities, we bridge the gap between performance and API testing. Armed with this knowledge, testers are empowered to ensure the reliability and precision of their applications in a rapidly evolving digital landscape, making them adept at handling the intricate demands of modern software testing.