If you are working on SOA-based projects, you won’t deny the fact that testing web services can sometimes drive you crazy and when you are on the testing side, the effect is even more!
I have been testing end-to-end web applications for a long time, and web services have always been an integral part of the systems I have tested.
Testing web services had been a daunting process till I stumbled upon soapUI tool for web service testing over a year ago.
The proof of how easy and useful I find it to use is the fact that I utilise it every day (of course, only on the days when I work ;)).
soapUI (by Smartbear) is a great tool to test and demo REST/WADL and SOAP/WSDL-based web services.
In this quick tutorial, I will show you how to test web services in soapUI tool.
Let’s get started.
Step #1. First of all, download soapUI and create a new project!
Follow the path: File >> New soapUI Project or just click anywhere in soapUI tool and use ‘Ctrl+N’ to create a new project.
This will bring up the new project setup pop-up which looks like this:
Step #2. Now, name the project and point it to a valid WSDL/WADL. In this tutorial, I am calling the project as “QST soapUI Tutorial” and pointing it to the sample WSDL file provided by soapUI team.
For your convenience, I have given 2 sample WSDL URLs below. You can run either of these to get started with soapUI.
For more free sample WSDL URLs for web services, check this post.
Once your ‘New Project’ window looks as shown in the screen grab below, click on ‘OK.’
Now, at this point, you might have a question, “Why do I need to import a WSDL?” Well, mostly the soapUI projects are based on WSDL however, it is not compulsory to import a WSDL to test a web service.
Then, why the hassle?
The advantage of using a WSDL is, it contains all the crucial information about the web service to be tested – Sample Request and Response, Web Service contents and much more.
WSDLs make your life much easier, especially when you are just getting started with testing web services. To get started, I recommend getting the WSDL files – your project developers/web service architects should be able to help to get them!
Step #3. Based on the WSDL source you use, soapUI will load the related definitions and configuration and will show up the operations in the Web Service. If you have followed the steps correctly, below is how the navigator looks.
You can double-click on the project name in the navigator to see the overview of any project and related details. As you become an advanced user of soapUI, this window provides some valuable information which you would need going forward.
In the same way, clicking on the Web Service gives you an interface-level view of the WSDL itself.
Step #4. Now, how to test the web services in soapUI tool!
With all the interface operations shown in the WSDL navigator screen, navigate to the service request in the test layout tree and double-click on the Request. This will open up a stubbed request and response with comments to help you fill it up.
Fill the mandatory field tags and click on the Run (Play) button.
In the below example, I have simply added the values in the request for currency conversion, and once I click on the green Play (Run) button, it brings back the response from the server, which will show in the right section in the below image. (Click image to enlarge)
The Request/Response are by default set to XML format. You can click on ‘Raw’ tab in either Request or Response to get a full view of the HTTP request made to the server, and the response returned.
Over to you!
This is how you use soapUI for web services testing!
I hope you find this introductory tutorial to soapUI testing tool helpful. Do give soapUI a try and if at all you stumble upon any issues, let me know in the comments below.
If you think this tutorial about soapUI web services testing could help your colleagues and friends, please do tweet it and share it on facebook.
Till then, happy testing!
Latest posts by Amandeep Singh (see all)
- 40+ Super Useful Chrome Extensions for Software Testing [2017 Update] - February 24, 2016
- Writing Test Cases for Brochure/Catalog Based Websites [Checklist] - December 29, 2015
- Latest trends in Software Testing 2015 – How the World Tests? - November 19, 2015