Do not abuse JMeter for -complex- Automated Functional Web Service Testing

Ooh ooh oh, more often JMeter is used to create complex test suites to execute functional test scripts against a Web Service. It’s perfectly possible with JMeter, but is this the most efficient way? It has to has to do with the project scope and priority, I think. As stated on their website, JMeter is designed to test performance.

“Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types.” JMeter website

In my view, JMeter is not the best tool to write a bunch of functional test scripts for a Web Service (infrastructure). You will mostly end up with some unmaintainable throw-away test automation scripts, which took quite some effort to create. However, JMeter is one of the best performance testing tools.

You might want to perform some pre (insert data in a database) and post (assert complex XML / JSON responses) actions while executing functional test scripts. Here for, JMeter is not that handy and flexible. Better is to write your test scripts in a programming language, this allows you to do more complex things and create a maintainable test suite (using abstraction). You can apply programming principles (such as: DRY (Don’t Repeat Yourself), KISS (Keep it Simple, Stupid!), etc.) and you can create an abstraction layer (Each significant piece of functionality in a program should be implemented in just one place in the source code.).

I will put my ‘RESTful Web Service Automation Testing Framework’ publicly available on Github, if I find some spare time. (This will include detailed example)

Share This: