Speedup REST API Testing via recording in vREST
Dheeraj Kumar Aggarwal
Helping businesses solve API and Traceability problems | Product Evangelist | Atlassian Expert | API Automation Expert | Creator of vREST NG
Hi friends, in my previous post, I discussed about automating your REST API Testing with manual insertion of test cases. In this post, I will demonstrate the most powerful feature of vREST "Record and replay".
Why to write test cases manually? When we can just record them. Speedup the development of your REST API testsuite via vREST browser extension.
vREST provides a browser extension (currently available only for Google Chrome) which is a simple but yet powerful tool to help you record the HTTP requests of web application under test and their responses and it will automatically store them as test cases in vREST. This extension can also be configured to filter out HTTP requests according to content type and URL pattern for recording.
Just test your web application by navigating in the application, vREST recorder will record desired HTTP requests and store them as test cases in vREST automatically for you.
To use this extension, you need to first register an account on vREST, and create an instance. And install this extension directly from Chrome Web Store in your Google chrome browser.
First we need to configure this extension before we start recording the test cases. Let us take a step by step approach to configure this extension.
- After the installation of this extension, an extension icon will appear in the browser navigation bar.
Click on this extension icon and select "Configuration" menu.
- After that vREST Chrome Extension Configuration page will open as shown below:
- Provide the following details in the vREST Chrome Extension Configuration screen
a) Instance Name: Provide the instance name of the vREST application.
b) Project: Provide the vREST project name where you want the recorder to store recorded test cases.
c) Filters: Filters specify whether a HTTP request will be recorded or not according to its content type and URL.
Just save the configuration. Now, let us see, how we can use this extension to record our test cases.
- First open the web application in Google Chrome which you want to test.
- Then Click on extension icon in browser navigation bar and select "Start Recording".
- Extension icon will be colored green to signal that Recorder is in recording mode.
- Now, all you have to do is to test the web application manually covering all scenarios/conditions, browser extension will record the HTTP traffic according to your configuration rules and store them as test cases in vREST. You can see the recorded test cases in vREST. Let us take a look at the recorded test cases in vREST.
a) List of recorded test cases
b) A single recorded test case details
c) Test Case request parameters
d) Test Case Request Headers
e) Test Case response expected body
f) Test Case response expected headers
- Now, we should provide some summary to our test case to make it more readable and manageable.
- Now, you may need to tweak your test cases with variables, because your test cases may respond some dynamic responses. But that feature is out of the scope for this post.
Your automated test suite is ready. You can see, how simple is that to record your REST API test cases. Do try out vREST and share your feedback with us.