Thursday, September 29, 2011

Automated API testing

If you download the free SOAPbox testing tool, you may not realize that (a) you can use it to test REST APIs, and (b) this testing can be automated.

SOAPbox comes with a command-line tool called sr (Service Request) which will automate requests to an API or Web Service. Here is how you can use it to call the healthcheck API on the Vordel Gateway, when the Gateway is running on the same machine:

sr -v GET -h localhost -u/healthcheck -s 8080 -p10 -d10

The "-p 10" means to run ten parallel threads. "-d 10" means to run for ten seconds.

Definitely a very useful tool to simulate and test API access.