Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

REST functionality test suite, alternative to SoapUI?

Tags:

rest

soapui

I am in search of a REST functionality test suite. What I have in mind is a tool that allows me to have several "blocks" (script, function, class, you name it), one for each API function I have in our system.

Then, I must be able to order these blocks to build Functional Tests. For example: I have an Auth API that accepts user/password as parameter and returns an access_code. This access_code should be used as parameter to the leaderboard API. The leaderboard API can return a parameter to be used in the Awards API, and so on.

I'd like to have blocks for each API so I can quickly build a test with the flow AUTH --> Awards --> Messages, for example, as for Auth --> Messages --> Leaderboards.

I was looking at SoapUI yesterday and it looks promising, but some quirks are holding me back (if I edit the Resource, I have to delete and create all tests that use this resource again, to name the most annoying one -- when you have near a hundred APIs to test, any change in the Resource can generate a lot of rework, and the way it uses to pass results from one test to another is bizarre -- being nice here).

I was thinking about using shell scripts (one script/function for each API, and then write a script to glue them together as needed), but I think it will take too much time (I am not that proficient with shell script, and curl is known to not work very well with some of our APIs).

JMeter seems interesting, but I am not sure if it will work in such a modularized way, nor if it supports REST to be totally reliable for this.

I don't mind spending some time learning a new tool, but I need to be able to easily maintain all these APIs up-to-date.

All that said, any other suggestions? How do you test your REST APIs out there?

like image 416
Daniel Avatar asked May 18 '26 07:05

Daniel


2 Answers

I don't think you can use a tool designed for SOAP to test your REST API. I mean for the basics you can use whatever you want, for example node with curl and jasmine, or anything else, that part does not really matter I think. I'd concern more about test maintainability...

REST architecture has a HATEOAS principle which says that the REST webservice should provide abstract controllers and the client should use those controllers instead of building new ones from scratch. This prevents duplication of business logic and makes your REST clients hard to break for example by using a different URL template or adding a new feature.

If you want to test a REST API, I think you should consider to build an automated client for testing purposes. This client should parse the hypermedia - returned by the REST webservice - in order to follow the links it contains. It should recognize the links after their link relation (since this is the current quasi-standard) they contain. So being simple and using cURL with URLs created by the current test is not an option I think... Currently I don't think there is any universal tool for this kind of job, you have to write it yourself by using a HTTP client and a testing framework... Btw. this automated client could be an example for how to build a client for your API, so this could document your API the way usually unit tests document classes...

like image 181
inf3rno Avatar answered May 21 '26 20:05

inf3rno


You can read the article that describes some SOAPUI alternatives - 5 Best SOAPUI alternative applications.

You might also check 12 Great Web Service Testing Tools for a brief description of popular REST testing tools.

like image 45
Joxi Avatar answered May 21 '26 20:05

Joxi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!