Jmeter Tutorial Part 6

Part 6 – How to test web services with Jmeter

In the previous tutorials we learned how to build regular HTTP requests.  In this post we will look at how to create HTTP requests that test responses from web service requests.

The standard sampler for this purpose used to be what is called a SOAP/XML-RPC Request.  This sampler is depreciated and is no longer supported.

The standard HTTP Request sampler is robust enough to handle most web service requests.

Add an HTTP Request to your test.  Please note that in the Method dropdown I have selected POST.  Next click on the Body Data tab.  This is where you can paste your XML:

01_xml.png

Alternatively, click on the Files Upload tab and specify a path for your XML:

02_filedata.png

It’s that easy.  Run the test and it will generate this POST request.

You will probably want to add a post processor to your HTTP Request to verify that you are getting a successful response from the server.  I would suggest using one of these:

  • JSON Path PostProcessor
  • Regular Expression Extractor
  • XPath Extractor

03_proc

Header Manager

headerMgr

You might need to add a Header Manager to your HTTP Request so the target server can interpret your request.  For example, a Header Manager like the one pictured below might be required in order for your HTTP Request to work:

04_manager