automation, qa, web services, rest, soap, soapui

API Testing tips and tools

Many times is difficult to start on API Testing. Here are some tips and recommended tools to start.

Technology behind API. Here you need to  know what technology is around the API that you need to test. it could be REST, SOAP XML-RPC, etc. This will help us to select the correct tools to start the test and develop in the future a framework if it is required.

API Reference. first you  need to know the API, Services, methods, datatypes,etc. without this reference will be difficult start to test an API. so first ask for API reference or documentation.  You need to know what parameters receive each method and what is the expected result of each one of them. also the exceptions and errors.

Manual or Automated test.  We need to know if the testing over our API will be manual or automated. If the testing will be manual then we don’t require so much. but if testing will be automated we need more research about the tools and the best way to automate the API.

Scope of testing. You need to define the scope of the test, how many services and methods will be tested and what type of testing we will do (Acceptance, Negative)

Some Tools used in API testing

There are many tools that can be used in API testing according to tester preferences here are some of them (mostly used on manual testing)

  • Command Line tools (CLI). 
    • curl. If you like the command line (as me) this tool is very helpful combined with other add-ons in python mainly. you can test REST specially using this tool
  • UI Tools. These provides an GUI interface to work with the API, most knowing below:
    • SOAPUI. This is powerful tool that can be used to test REST, SOAP and XML-RPC, its main disadvantage is that consume a lot quantity of RAM
  • Addons or Extensions tools. most used in a browser. If you like to work on browser this tools are for you.

Frameworks to test API

If you decide to automate the API Testing you need to have a framework. Here are 3 cases:

  1. Develop your own framework (here you need to select the technologies that fit best with your project, select the correct language and see if it provides the interfaces to interact  with API services like REST, SOAP, etc)
  2. Use existent frameworks (Select the correct framework and to know if it provides all the necessary for your project)
  3. Mix 2 above, you can have an existent framework and extend it according to your requirements.

Here a list of some API test frameworks

  • Django. framework developed in python
  • Frisby. framework to test REST API developed in node.js and jasmine
  • SOAPUI. is also considered a framework and can be used easily in API testing automated.

 

References

http://www.soapui.org/

http://curl.haxx.se/

http://www.django-rest-framework.org/api-guide/testing/

http://frisbyjs.com/

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: