How to test API?
https://www.zyxware.com/sites/default/files/styles/user_image/public/default_images/index.png?itok=2YmREnrP
BY rajula.s
4 years ago
Software-Testing
0 comments comment

API, Application Programming Interface is used for interacting the components in a software. A website uses different API's for communicating the software components. As user, we can see only the interfaces and not the working of API's behind those interfaces. This article focus on how we can ensure the API we implement works or not. Websites provide different extensions for testing API.

Here I am discussing on how to test API using Advanced Rest Client, an Add-on provided by the browser Google Chrome. All you have to do is install the add-on and fill the parameters and get response.

Steps to install

  • Go to chrome://extensions/
  • Enable the extension 'Advanced REST client'

Let us take the example of Login page. Here we need to pass values for following fields:

  • Request url - The address to which the request should be sent.
  • Method - Defines the request methods say get, post etc
  • Request Parameters - List of variable parameters / datas
  • Response Parameters - Expected response/messages

On loading the application (as shown in the image below.) you can see fields for entering request URL, Method and request parameters. Here select the Method as Post. API, Application Programming Interface is used for interacting the components in a software. A website uses different API's for communicating the software components. As user, we can see only the interfaces and not the working of API's behind those interfaces. This article focus on how we can ensure the API we implement works or not. Websites provide different extensions for testing API.

Here I am discussing on how to test API using Advanced Rest Client, an Add-on provided by the browser Google Chrome. All you have to do is install the add-on and fill the parameters and get response.

Steps to install

  • Go to chrome://extensions/
  • Enable the extension 'Advanced REST client'

Let us take the example of Login page. Here we need to pass values for following fields:

  • Request url - The address to which the request should be sent.
  • Method - Defines the request methods say get, post etc
  • Request Parameters - List of variable parameters / datas
  • Response Parameters - Expected response/messages

On loading the application (as shown in the image below.) you can see fields for entering request URL, Method and request parameters.

image.jpg

Here select the Method as Post. So our input will be as follows:

  • Request url - Give the URL
  • Method - Post
  • Request Parameters - useridentifier- Email or username
    password - password

For the above request parameters, the response parameters would be as follows:

  • Response Parameters - On Success - status will be TRUE and uid will contain user id
  • uname will contain user name
  • umail will contain user mail
  • access_token = The access token that would be used to identify this particular user
  • message - will contain message

Here you can test the feature by executing all positive and negative cases and check whether the result (Response Parameters) are correct or not. Enjoy testing:)
So our input will be as follows

  • Request url - Give the URL
  • Method - Post
  • Request Parameters - useridentifier- Email or username
    password - password

For the above request parameters, the response parameters would be as follows:

  • Response Parameters - On Success - status will be TRUE and uid will contain user id
  • uname will contain user name
  • umail will contain user mail
  • access_token = The access token that would be used to identify this particular user
  • message - will contain message

Here you can test the feature by executing all positive and negative cases and check whether the result (Response Parameters) are correct or not. Enjoy testing:)


RELATED ARTICLE

/themes/custom/zyxpro_light/images/placeholder.png
close

on 30th May 2012 / by anju.r
A software bug is defined as an error or failure or fault in a system or computer program that produces an unexpected or incorrect result. This is applicable for any Drupal/non-Drupal website. The bug life cycle in a Drupal website consists of steps from identification to closure of a bug. Different stages of Bug Life Cycle are: Drupal Software Testing Leave a reply Your email address will not be published. Required fields are marked *
Leave a reply
Your email address will not be published. Required fields are marked *

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
The content of this field is kept private and will not be shown publicly.
CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.