REST Webservice Testing

Creating Test Case with REST Webservice API

You can test your Salesforce custom REST services or the generic REST Service provided by Salesforce by making REST API calls from Provar and see if the responses are coming back fine for the various methods exposed. Below steps show how to create a test case that makes a REST API call with Get Method to Salesforce to query for an Account with object Id.

Create a test case and invoke the Salesforce connection as the first step. Set a variable ‘test’ to carry the value of the object id of the account to be queried. Drag and Drop the API ‘REST Request’. Choose the Salesforce connection invoked in the first step. Select the option Generic REST Service in REST Type. Enter the following resource URL: /data/v34.0/sobjects/Account/{test}. Select the ‘GET (read/query)’ method.  Enter the name of a variable in Result Response where you want to capture the  parsed JSon response and choose an appropriate Result scope. Run the test in debug mode and check the Variables and Test Run sections for more info.


Leave A Comment