Table of contents
1.
Introduction
2.
Webservice Test Plan
3.
Create Webservices Test Plan
4.
Frequently Asked Questions
4.1.
How to see the response data of API in JMeter?
4.2.
Can we filter out the response data in the request?
4.3.
Can we do any other request rather than an HTTP request?
4.4.
Do we need an API key to use an API?
4.5.
Can we only perform the GET request?
5.
Conclusion
Last Updated: Mar 27, 2024

What is the Webservices Test plan in JMeter?

Author dhananjay
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

This blog will discuss the webservices test plan in JMeter and how we can write a webservices test plan in Jmeter step by step. JMeter is an open-source testing software developed by Apache based on pure java programming. JMeter is used to measure and observe the performance, functional, and load testing of web applications created in java.

We will learn how to create a webservices test plan in JMeter to perform the relevant testing for our application.

Webservice Test Plan

Webservice Test Plan

Before we get into the webservices test plan, we should be familiar with a few terms like what is web service and API so that we can have a better understanding of the article.

Webservice is a standardized way that guides the machines to communicate with each other over the internet. For example, client and server interaction can be an excellent example of a webservice. XML is the language that is widely used to create webservices.

We should also know about APIs and types of web APIs. An API is an application programmable interface that uses a medium to transmit information or data between the client and server to make communication possible. 

Two types of web API are widely used to communicate over the internet.

  1. SOAP API
  2. REST API

We will use the REST API method to demonstrate the webservices test plan.

For testing purposes and to demonstrate REST API methods, we will use APIs already available to us over the internet.

We will use the studio ghibli API  to demonstrate the webservices test plan. You can use any REST API you want, which is legal and publicly available or create one yourself.

Create Webservices Test Plan

1.First; you should open your apache JMeter application.

2. Then you should name your test plan whatever you want, or you can use the default name.

4. After this, you must create the thread group by right-clicking, hovering over add element, and clicking on thread groups.

thread group

4. Once you have created a thread group, you need to make an HTTP request under the thread group by right-clicking on it, going into the sampler section, and selecting the HTTP request.

http sampler

 

5. Once you create an HTTP request sampler, you must right-click on the thread group node, go to the listener component, and select the view result trees element to display the API output.
 

6. Once you have created all this, you are set to test out your webservice API.
 

7. Go to the HTTP request node and fill out the required fields to make the testing possible, like in the image below.

http request node
http request node
  • In the server name or IP field enters the name of the API you are using or the IP.
  • Then, in the Path field enter the attribute you are accessing from that API.
  • We are using films as the path to demonstrating the webservices test plan and displaying different films by studio ghibli.
  • You can also set query parameters to filter out the content and send the parameters with the request section.

 

8. Now run the test plan, and you will see the response data in the view results tree node. If the status is 200, that means the API is working.

api response data
api response data

 

Must Read Apache Server

Frequently Asked Questions

How to see the response data of API in JMeter?

You need to create a listener in the JMeter to display the request's status code and the response data.

Can we filter out the response data in the request?

Yes, we can filter the response data by declaring the name and value in the send parameter with request section.

Can we do any other request rather than an HTTP request?

Yes, we can make other requests. Go to the sampler section and check out the requests you can execute.

Do we need an API key to use an API?

You need to generate the API key for some of the Public APIs, or you can use one that does not require an API key.

Can we only perform the GET request?

No, you can make other requests like POST and PUT requests in the JMeter HTTP requests.

Conclusion

In this blog, we discussed the webservices test plan in JMeter. We have also discussed the elements we can use in the JMeter webservices test plan. In the end, we learned how to create a webservices test plan in JMeter with the help of a public API.

To learn more about JMeter, check out the following articles.

To learn more about DSA, competitive coding, and many more knowledgeable topics, please look into the guided paths on Coding Ninjas Studio. Also, you can enroll in our courses and check out the mock test and problems available to you. Please check out our interview experiences and interview bundle for placement preparations.

Happy Coding!

Live masterclass