If you are working on SOA-based projects, you won’t deny the fact that Web Services can sometimes drive you crazy and when you are on the testing squad, the effect is even more!
I have been testing end-to-end Web Applications for more than 5 years now and Web Services have always been an integral part of the systems I have worked on. Most of the times, testing them has been a pain and never been easy till I stumbled upon soapUI web service testing tool over an year ago and the proof of how easy and useful I find it to use, is the fact that I utilize it everyday (of course, when in office ;)).
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 using soapUI tool. So, let’s get started…
Step #1. First of all, download soapUI from here and create a new project! Follow the path: File >> New soapUI Project or simply 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 naming 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.
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 webservice. Then, why the hassle?
The advantage of using a WSDL is that it contains all the crucial information about the web service to be tested – sample Request and Response, Web Service contents and much more. So basically, WSDLs make your life much easier, especially when you are just getting started with testing Web Services. So, I would recommend getting the WSDL files to get started – your project developers/webservice architects should have it!
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 would look like.
You can double-click on the project name in navigator to see the overview of any project and related details. As you become an advanced user of soapUI, this window provides some very important 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 Service in soapUI tool! Here is how…
With all the interface operations shown in the WSDL navigator screen, navigate to the service request in the test layout tree, double-click on the Request. This will open up a stubbed request and response with comments to help you fill it up.
Fill in the mandatory field tags and click on the Green 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 button, it brings back response from the server, which is shown 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 which was made to the server and the response returned back.
And, this is how you test an Interface/Web Service using soapUI tool!
So, how do you find soapUI Web Services testing tool? Do give it a try and if at all you stumble upon any issues, let me know in the comments below.
Also, check out this article and nominate your colleagues/teams for software testing awards.
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