Forum Discussion

smitadegolia's avatar
14 years ago

How to store response values into Excel using SoapUI?

Hi,

I am using SoapUI for automation testing using SOAP/HTTP. I want to store Soap response (xml) values into Excel for reporting purposes. Is there a way through Properties or Groovy to access the XML values and store them in Excel.

Eg: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetWeatherByPlaceNameResponse xmlns="http://www.webservicex.net">
<GetWeatherByPlaceNameResult>
<Latitude>30.6171017</Latitude>
<Longitude>99.62553</Longitude>
<AllocationFactor>2.7E-05</AllocationFactor>
<FipsCode>48</FipsCode>
<PlaceName>LONDON</PlaceName>
<StateCode>TX</StateCode>
<Details>
<WeatherData>
<Day>Thursday, June 16, 2011</Day>
<WeatherImage>http://forecast.weather.gov/images/wtf/sct.jpg</WeatherImage>
<MaxTemperatureF>100</MaxTemperatureF>
<MinTemperatureF>75</MinTemperatureF>
<MaxTemperatureC>38</MaxTemperatureC>
<MinTemperatureC>24</MinTemperatureC>
</WeatherData>
<WeatherData>

I want to store values of the following nodes in XL by accessing the response XML.
<MaxTemperatureF>100</MaxTemperatureF>
<MinTemperatureF>75</MinTemperatureF>
<MaxTemperatureC>38</MaxTemperatureC>

Please revert ASAP

2 Replies

  • Finan's avatar
    Finan
    Frequent Contributor
    I haven't yet written a groovy script to write to excel, but I would recommend you try something like http://groovy.codehaus.org/Groovy+for+the+Office

    The problem of accessing the XML values is quite easy to solve.
    You can either use the "getData functionality" or create an XML reader to read from the response.
    Note: this is quite easy in soapUI pro, don't know if it is different in soapUI.
  • AHlimon's avatar
    AHlimon
    New Contributor
    That's great work. I have work with excel file and it creates my work easy.