Monday, March 11, 2013

Working with SOAP UI Pro part-II

In this blog I would like to share my experiences in working with SOAP UI Pro.

Using SOAP UI Pro makes the process much easier with it's pro features. The Pro features include Data source, Data source loop, Data sink, selecting elements from XML for property transfers and the Outline view and Form view of your WSDL.

I will explain the usage of pro features with simple scenario.

Scenario:

I love travelling. I am planning to travel from SYD-MEL-AKL-LAX.

In this case SYD-MEL is Domestic, MEL-AKL is Short Haul International, AKL-LAX is Long Haul International. I do the following steps.

Soap UI

Assumption: direct flights available

The steps that we follow to book a flight are

1. Fare Search for a domestic/short haul/long haul flight based on departure date, Origin & Destination
2. Selecta flight
3. Create a reservation

In API perspective, search for a flight and create reservation are two different service calls.Following could be the steps to automate those steps in soap UI

1. Use Data source with Departure & arrival properties
2.Use Groovy script to generate departure date
3. Use the above generated departure date and the departure city and arrival city from Data source in the fare search request
4. Create a property transfer to transfer the values from fare search response to PNR create request
5. Data sink to store the PNR created in the above step
6. Data source loop to loop through all the above steps for all the data in the data source

Data source and data source loop are always used together. Using data sink you can store the selected values from the response in a notepad or excel.

Form view / Outline view

As the wsdl will have both mandatory and optional elements,to form a proper request it would be hard sometimes when there are more number of elements in the request. In this case I found form view to be really helpful. Also another advantage in form view is it displays the values for the elements in a drop down if they are specified in XML Schema Definition (XSD).

Outline view gives us a better idea in understanding the response. In the above explained example for the fare search, the response displayed could contain multiple flight options with different price quotes per class for each flight. It is difficult to check all the flight & price options in XML View or the raw view.

Happy Reading!!!!