ADVANCED REST CLIENT IN API TESTING

Advanced REST Client API is used to test interaction between various levels of software components. Testing is done using the API endpoints validation is performed based on the return value. Response can be Success true or Success false which can be tested by common testing techniques.

In Advanced REST Client API calls are made through GET and POST methods. In GET method key values are passed along with the URL whereas in POST method the information are transferred in a hidden manner. These are the two ways to transfer information from a web browser to a server within the URL and within the body of HTTP request.
How to add ARC in chrome:

Go to Google click on customize and control google chrome -->More tools--> Extensions.


Click on Extensions we can redirect the chrome://extensions.

Click on "Get more extensions" then it will redirect to the below page.


Search “Advanced Rest Client” in Chrome web store and choose “Apps” and click on “ADD TO CHROME” then move to below page.


Click on “Add app”, after click on "Add app" then ARC will downloaded.After completion of downloading then it will automatically a new tab is open in chrome, then you will find number of apps over there and "ARC" is also one of the app, and you have to choose "ARC".


Right click on ARC -->Create Short cuts.
After clicking on this it will shows the pop up then click on Create for adding the Desktop.
What is API:
An API or Application Programming Interface is a set of programming instructions for accessing a web-based software application.
In other words, a set of commands used by an individual program to communicate with one another directly and use each other's functions to get information.
For example, a Google website can have API for various functions like search, translations, calendars, etc.
In general API's are like below, they have server name, paths.., etc
http://<servername>/v1/export/Publisher/Standard_Publisher_Report?format=csv

Common issues found in API testing:

  • Page not available for the corresponding API call.
  • Issues in getting response for an API call.
  • Error message displayed is incorrect.

How to Test REST API:

Rest API can be tested with tools like:
  • Advanced Rest Client
  • Soap UI
  • Postman-Rest Client
There are mainly 4 methods involve in API Testing like Get, POST, Delete, and PUT.
  • GET- The GET method is used to extract information from the given server using a given URI. While using GET request, it should only extract data and should have no other effect on the data.
  • POST- A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms.
  • PUT- Replaces all current representations of the target resource with the uploaded content.
  • DELETE- Removes all current representations of the target resource given by a URI.
  • OPTIONS − Used to get the supported operations on a resource.

Features of Advanced REST Client:

  • Supports all the HTTP Methods: GET, PUT, POST, DELETE
  • Custom HTTP Headers Editor
  • Custom Payload Editor
  • Easy to analyse the Response data
  • JSON Response Formatter and Viewer
  • Define content-type for POST methods including multipart/form-data
  • Browse and attach files for upload
  • Projects: Can save commands into groups for later reference and execution
Header:
Insert authorization key in the header field. Select authorization in header and provide the key to be passed along with the URL. This is required to gain permission to access content available at destination.

Status and loading time:

Status of request and along with loading time can be obtained for an API call .

Response:

Response is available in RAW as well as in JSON format. This response can be used to validate the interaction of software components. Response can be compared with expected response to validate the API call.

below are the steps to test with Advance Rest Client,

Steps for Testing REST API:

Here we are using Advance Rest Client(ARC) in chrome browser.

Step 1: Launch the extension once it is installed successfully.


Step 2): Enter the URL of the API in the URL textbox.


Step 3): Select the radio button for the type of HTTP method to hit- e.g. POST.


Step 4) : Provide Headers (if required), in the Headers text box. Sometimes we need to give headers like
Content-Type: application/json
X-User-Type: standard


Step 5): Under Raw Payload, pass the request body of the API in the form of key-value pairs e.g. {{"key1":"value1","key2":"value2"}. If it is post API, then we need to pass body or parameters in Raw Payload and click on send.

Step 6): Set the required content type e.g. application/json
Step 7): Hit the send button. After clicking on "send" button, you will see response something like this.

Here, we have used "POST" method, in the same way, we can use remaining methods like GET, PUT, DELETE, etc.

After calling the request,you can save your request by selecting the "save" button.


After click on save a new popup will be displayed then you have to click the check box as “Save in Projects” and you will find a page like below.
In this page you have to specify your “Request name” and “New Project name”.












Click on “Save”.
After click on Save, your project is saved into your projects folder.




Validating the results:
Mainly, for API testing, we need to check response code, a response message, and response body.
Below are the various response code, one might encounter while API testing.


REST API Test Tool:
  • SoapUI Pro Its an easy-to-use tool that allows you to test REST APIs without writing any scripts
  • Advanced REST client (for google chrome- select app from list)

Challenges for API Testing:

The interesting problems for testers are:         
  1. To make sure that the test harness varies the parameters of the API calls in such a way that it verifies the functionality as well as expose the failures. It includes exploring boundary condition and assigning common parameters
  2. Creating interesting parameter value combinations for calls with two or more parameters
  3. Identifying the content under which the API calls has to be made. Which might include setting external environment conditions ( peripheral devices, files, etc.) as well as internally stored data that affects the API
  4. Sequencing API calls as per the order in which the functionality will be executed
  5. To make the API produce useful results from successive calls.



Thanks & Regards,
Nagamani Pragada,
Technical Trainee,
MOURI Tech PVT LTD.
http://www.mouritech.com/



Comments

  1. Your blog was very interesting & easy to understand. Thank you so much sharing that informative blog.Inventory Audit

    selenium training in chennai

    aws training in chennai

    ReplyDelete
  2. I love to read your posts. I really appreciate for this great information, I have a liking for your posts. Thanks to your sharing, I can enrich my knowledge. Thanks a million.

    app email with loveemailwithloveapp

    ReplyDelete
  3. This blog really very help full for all developers and students thank you for writing this blog and now Django training development language more job opportunities available all development company's thank once.

    Angularjs training in chennai | Angularjs training in velachery

    ReplyDelete
  4. Expected to form you a next to no word to thank you once more with respect to the decent recommendations you've contributed here.fire and safety course in chennai

    ReplyDelete
  5. I enjoy what you guys are usually up too. This sort of clever work and coverage! Keep up the wonderful works guys I’ve added you guys to my blog roll.
    nebosh course in chennai

    ReplyDelete

  6. You won't believe me, but I was planning to write a blog very similar to the one you have posted here. Great work!

    Selenium Training In Chennai

    Java Training In Chennai

    ReplyDelete
  7. I was searching for the information on java and this blog is really useful for me.
    Thanks for sharing this blog it was really innovative.
    java training center in coimbatore
    java training
    java certification course
    java certification training
    java training courses

    ReplyDelete
  8. Hi! Thank you for the share this information. This is very useful information for online blog review readers. Keep it up such a nice posting like this.
    Pattern Making Software and Tailor App

    ReplyDelete
  9. Expected to form you a next to no word to thank you once more with respect to the decent recommendations you've contributed here.
    fire and safety course in chennai

    ReplyDelete
  10. Hello sir ,
    How are you.I am always updated with blog posts,
    i noticed that your post is well organised and also charming i visited a website that you linked up

    with your blog, this is really helpful , i have another website similar to that and i also suggest

    you to checkout this website Buy Google Reviews i think its really helpful to you.

    Thank you

    ReplyDelete

Post a Comment