Sunday 13 December 2020

JMETER- Rest Api Testing

1. For testing purpose get rest api of getPlace from below url, https://openweathermap.org/current For this get registered for this site to received session id as per your login 2. Then go to jmeter, create Thread group by right clicking on Test Plan . 3. Once Created Thread group, right click on Thread and create HTTP Request
4. From step 1 , you will get rest api URL, api.openweathermap.org/data/2.5/weather?q={city name}&appid={API key} Divide this url in below format in jmeter, Till org its server name, path is till weather and parameters we will add in parameters section, Appid is your app key (follow step 1)
5. Right click on Thread Group- Add- Config Element-User Defined Variable
Use above value in step 4 screen shot as parameter 6. For verification, right Click on API name(get Weather) and add listener as View Result Tree And add Assertion as json jmespath assertion, Expected value is User defined Variable
7. Just click at top green icon and verify result by clicking on view result
Happy Learning :)