To show the how to performance test of any webservice which is taking some input and returning output in response , i am using Yahoo Weather service for Demo purpose .
http://weather.yahooapis.com/forecastrss?w=2442047&u=c
Input 1 : W = 2442047 >>> Location Id
Input 2 : u = c >> Celsius( Temp )
If User direct Request the above url then it would return response like :
Yahoo! Weather - Los Angeles, CA
Yahoo! Weather for Los Angeles, CA
Conditions for Los Angeles, CA at 6:47 pm PSTFriday, December 14, 2012 8:17 AM
Current Conditions:
Fair, 12 C
Forecast:
Thu - Partly Cloudy. High: 16 Low: 8
Fri - Partly Cloudy. High: 14 Low: 9
Full Forecast at Yahoo! Weather
(provided by The Weather Channel)
To Automate the above requirement follow the Step below :
3.Add Csv data set config provide the File name of csv file and Variables location,format
4.Add Test data in Csv File
5. To verify the Web service is working or not Add the Assertion >>
In this case you can add the Location name in text response Pattern and parametrize the assertion text . I don't know the all location so i am just adding the Response Code in Assertion
http://weather.yahooapis.com/forecastrss?w=2442047&u=c
Input 1 : W = 2442047 >>> Location Id
Input 2 : u = c >> Celsius( Temp )
If User direct Request the above url then it would return response like :
Yahoo! Weather - Los Angeles, CA
Yahoo! Weather for Los Angeles, CA
Conditions for Los Angeles, CA at 6:47 pm PSTFriday, December 14, 2012 8:17 AM
Current Conditions:
Fair, 12 C
Forecast:
Thu - Partly Cloudy. High: 16 Low: 8
Fri - Partly Cloudy. High: 14 Low: 9
Full Forecast at Yahoo! Weather
(provided by The Weather Channel)
To Automate the above requirement follow the Step below :
- Add the Thread Group >>Add the Http Sampler and add the Server name/ IP = weather.yahooapis.com in Path put the forecastrss?w=2442047&u=c
- Now w=2442047 and u =c need to be parametrized replace them with ${location} and ${format}
5. To verify the Web service is working or not Add the Assertion >>
In this case you can add the Location name in text response Pattern and parametrize the assertion text . I don't know the all location so i am just adding the Response Code in Assertion