How to test API?
https://www.zyxware.com/sites/default/files/styles/user_image/public/default_images/index.png?itok=2YmREnrP
BY rajula.s
3 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

more_horiz
close

on 30th March 2012 / by webmaster
Here are some basic SEO tests that you can perform on your Drupal/Non-Drupal website. Whenever a change is made in your site, run these tests for better results and for good SEO ranking. All these test cases points out to possible problems in the Drupal/Non-Drupal website. The observations and results of these tests can then be passed on to the web developer for updations. Check if the meta tags and meta descriptions are given and explains what the page is about in the page as well as html code. Check that the page titles are short and informative in page and html code. Check that the headings (h1,h2) are meaningful and exclusive in html code. Check that the images are 'Alt text' in html code. Check if the ' allow and disallow' given in the html code are working in proper way. Check that the Google analytics status is 'yes' in the google analytics module. Check that site information, site name and slogan are unique and accurate. Check the site loading time. Check if the mobile site is indexed by Google. Check through the w3c validator. Check if the site is shared with social media sites. Check if the 'bread crumb' is working fine. Use different free webmaster tools ; for example go to woorank.com/google.com/bing.com/yahoo.com and check the various SEO details. Check that the xml sitemap covers all links of the pages. Check that the custom 'search 404 error page' is created. Check that the page contents effectively communicates the topic of the page's content. Check that the structure of url is simple to understand and conveying the content information easily. Check if the pages not accessible by anonymous users are restricted in robots.txt by using free webmaster tool. Check the performance of the navigation in a website. Check if the anchor text is easy to convey the contents linked . Check if the backlinks are working in properly. Check whether a page has multiple URL. SEO Software Testing Test Cases Leave a reply Your email address will not be published. Required fields are marker *
close

on 03rd April 2012 / by webmaster
To ensure the security of confidential data in your Drupal site, testing has to be done to determine whether it protects its data and at the same time maintains its functionality. Web applications are always prone to unauthorized access to or modification of sensitive information. The testing done on the applications to remove such anomalies is called security testing. The following are some of the test cases for assuring the security of a Drupal website Authentication Test whether captcha is set to assure that the application keeps unauthorized users from accessing the Drupal site. Test whether the account should be locked after a determined number of failure attempts. Test whether the admin gets alerts or notification when the account is blocked due to failure attempts. Test whether security question is asked while creating an account. Test whether security question is asked for the password recovery. Test when password is encrypted using Secure Socket Layer (SSL) while sending it . Test whether system prints password characters while entering passwords. Test whether the pages can be accessed by copying and pasting the login URL again without entering the password. Test whether the password field support copy operation. Test if password field is reset to blank while moving next/back . Test whether the password is directly passed through the query string/URL without encryption. Test for the access after the session times out. and session time out settings. Test whether the system asks for changing the password periodically. Test whether the data/pages can be downloaded through FTP or any other source without valid authentication. Test whether the secured pages can be accessed through the browser's history.   Access Control Test whether the user can access admin data. Test whether the user should be able to access an unauthorized page by copying and pasting the URL. Test whether clicking the back arrow should redirect a user to the URL of the last users’ login or their last pages visited.   Buffer Overflows Test whether all data input fields must have reasonable field Lengths and specific data types. Test the amount of text limit allowed in free form fields.   Input Validation Test whether the system accepts illegal characters. Test the maximum length in the field. Test the minimum length in the field. Test the data type. Test whether null value is allowed in the field. Test the format in the field.   Cross site Scripting Test whether the generated pages are properly encoded to prevent unintended execution of scripts. Test whether the dynamically generated pages do not contain undesired tags   SQL Injection Test whether some query inserted in user input fields is being executed by the application.   Improper Error Handling Test whether error messages contain only secured information. Test the response time for the error messages.   Session Management Test for session hijacking vulnerability, if your application uses session identifier in the URL.   Insecure Storage Test whether information must be protected using strong encryption methods.   Conclusion Security requirement will change with respect to the external environment. Constant review and attention to the threat environment is necessary for maintaining a Drupal application's security. For more information, check Drupal Security Tips. Drupal Drupal Development Drupal Security Software Testing Test Cases Leave a reply Your email address will not be published. Required fields are marker *
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: New Opened Assigned Rejected Test Reassigned Closed Reopened Deferred New: When a tester posts a bug its status is New.Opened: New bug yet to be approved. So when the test leader approves it, its status changes to open.Assigned: When the test lead assign the bug to the corresponding developer , its status changes to Assigned.Rejected: Sometimes the developer feel that the bug is not genuine. So the developer rejects the bug and then the status of the bug becomes Rejected.Test: When the developer fixes the bug and sends it for testing, the status of the bug changes to Testing.Reassigned: If the tester found that the bug still exists or partially fixed, he send it back to the developer. Then the status of the bug is Reassigned.Closed: Once the bug is verified and assured that the bug no longer exists, its status changes to Closed.Reopened: If the issue still comes again, the tester change the status of the bug to reopened and the bug has to go all the above phases again.Deferred: If the bug is decided to be fix in the next version, the status of the bug is changes to Deferred. Drupal Software Testing Leave a reply Your email address will not be published. Required fields are marker *
Leave a reply
Your email address will not be published. Required fields are marker *

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.