soapUI Pro – How to test a web service

PerfectoTopAd

What is soapUI?

soapUI is a headless functional testing tool from SmartBear software. It comes in two flavors:


  • free open source version
  • pro version.

Two versions of soapUI

Since the free version is open-source, you can actually gain access to the full source code and modify as needed. The pro version is more user-friendly, and has additional functionality including a form editor, an assertion wizard for xpath, and SQL query builder.  Also – the pro version is dirt cheap at just $349 per year. That's thousands of dollars less than HP’s Service Test! (You can try the soapUI Pro version out for yourself free of charge for 14 days.)

How to use soapUI Pro to test a web service

For this example I'll be using the flight web service sample application that comes with HP Service Test 11.

  • First start the sample application and get the WSDL endpoint.

  • Create a new project in soapUI. Enter:
  • From the Project tree view select the GetFlights operation and rename the request to getFlight
  • In the Form view enter:
    • DepartureCity = Frankfurt
    • ArrivalCity = Los Angeles

    • Right click on the ‘getFlights request and add to TestCase

    • Name the ‘TestSuite' HP_FLIGHTS
    • Name the ‘TestCase' Flights
    • For the Add Request to TestCase screen take the defaults and OK
    • From the Project tree view select the CreateFlightOrder operation and rename the request to createFlightOrder
    • In the Form view enter:
      • Class = First
      • CustomerName = Joe,Colantonio
      • DepartureDate = 1/31/2013
      • FlightNumber = leave blank for now
      • NumberOfTickets = 1

    • Right click on createFlightOrder and add to TestCase HP_FLIGHTS – Flights. Take defaults and OK
    • Click on the Flights TestCase

    • Under the Flights ‘Testcase' dbl click on CreateFlightOrder


    • Right click on the ‘FlightNumber' field and select the Get Data..-> GetFlights –> Property[Response]


    • For the get a ‘Missing property value, use default value instead? Click Yes
    • In the Select Xpath window select hp:FlightNumber


  • Add XPath Match Assertion


  • Select XPath icon


  • For expected value enter 112


  • Run the Flights testcase

You should get a green bar that says finish and both test should have green status!

7 comments
Jamin - June 5, 2012

Hi Joe, I just want to ask how did you get the WSDL endpoint of HP Flight services application?

Reply
    Joe Colantonio - June 9, 2012

    Jamin » Hi – when you run the HP flight application it should show the Endpoints for the WSDL on it’s main screen.

    Reply
soapUI – How to Test a REST Service — Joe Colantonio - Helping YOU Succeed with Test Automation Tools | QTP-UFT-ALM-LoadRunner-Selenium-soapUI & more - September 6, 2012

[…] (If you're interested in learning how to use soapUI to test SOAP web services, check out my post/video: soapUI – How to test a web service.) […]

Reply
VAAS - January 8, 2013

HI Joe,

I ran the flight application but populates error as below –
“ERROR: The default prot is not available.
To change the port, edit the configuration file.”

Could you please let me know what port value I need to provide and how to find the valid port number?

Thanks in advance…..

Regards,
vaas

Reply
    Joe Colantonio - January 8, 2013

    VAAS » First if you are using Windows7 make sure that you right click on the Flight Application and Run as Administrator. If that does not resolve your issue The configuration file is in the installation directory, under a subdirectory called ‘SampleApplication’.  The file is called HPFlights_Service.exe.config.

    Reply
Abhay - July 27, 2015

Pls share the Flight application

Reply
    Joe Colantonio - July 28, 2015

    Hi Abhay the flight app is an HP app that comes with UFT. If you download the UFT trial version the app will install as well

    Reply
Click here to add a comment

Leave a comment: