Hello All,

Could you share please how to test webservices in QTP with webservice add-in using Data Driven methodology.

I have a web service operation that returns different xml files depending on the input.
the input is the same but the output is different
to make it easy suppose that my operation returns the following xml response if the city is wrong:

<ForecastReturn><Success>false</Success><ResponseText>City could not be found in our weather data. Please contact CDYNE for more Details.</ResponseText><State/><City/><WeatherStationCity/></ForecastReturn>

and if the city is right it returns another xml lets say something like below:


<ForecastReturn><Success>true</Success><ResponseText>City Found</ResponseText><State>NY</State><City>Schenectady</City><WeatherStationCity>Albany</WeatherStationCity><ForecastResult><Fo recast><Date>2012-10-11T00:00:00</Date><WeatherID>2</WeatherID><Desciption>Partly Cloudy</Desciption><Temperatures><MorningLow/><DaytimeHigh>57</DaytimeHigh></Temperatures><ProbabilityOfPrecipiation>& lt;Nighttime/><Daytime>20</Daytime></ProbabilityOfPrecipiation></Forecast>....... etc


I Parametrized the xml variables on the data table but my test fails if all variables are not entered.

for example the header of my data table was setup as follow:

City Success ResponseText State City2 Weather sationCity ... etc

And the first row is:

123 false City could not be found in our weather data. Please contact CDYNE for more Details. the rest of the columns are left empty because they are empty when the city is wrong


in the 2nd row i typed all the values that returned from the webservice operation when the city was correct.

so when I run my test with above rows the first test (first row) fails (because remaining cells are empty.)

the second passed

Is there a way to test a service operation whith multiple possible xml outputs using data driven (considering all possible outputs) and the test will run successfully?

Thank you.