Automated Testing Tool for Json-Rpc?

4.3k Views Asked by At

Can anybody suggest a good tool for automated testing of json-rpc interfaces?

We are using Json-RPC. We have looked at JMeter and The Grinder, but they don't seem to offer any slick way of testing ranges of arguments in our RPC calls. For example, with JMeter, we would have to set up a separate .json file for each set of parameters that we want to test.

Are there any good tools out there for automated testing of json-rpc?

We are looking for something with a GUI (like JMeter) as well as something that we can trigger from Jenkins.

As a very contrived example, let's say we have a call that takes json like this:

{ "jsonrpc": "2.0", "method": "move_to_tile", "params": { "userid": 123456, "x": 1, "y": 3 } }

I would be able to run a bunch of threads, each with their own userid sending various values for x and y.

2

There are 2 best solutions below

1
On

JMeter should be fine choice. You can execute JMeter tests from Jenkins using:

  • JMeter Ant Task
  • JMeter Maven Plugin
  • Command line execution

In regards to JSON, JMeter perfectly handles bi-directional JSON calls with a plugin (you'll need Extras with Libs Set to get REST Sampler, JSON Path Extractor, JSON Format Post Processor, etc.)

You can send JSON as request body or even construct it on the fly using JMeter Properties and Variables and any of JMeter Pre-Processors.

3
On

The robot framework is a keyword driven automated acceptance test framework written in python. You can create keywords in python that can do anything python can do, and then you can write test cases that make use of these keywords. It's a very good general purpose testing tool that can be used for all sorts of testing.

There is a GUI for creating and running tests, though I personally don't recommend it as the command line tools are quite nice, and you can create test cases in emacs, vim, notepad, visual studio, or any other plain text editor.

There is a jenkins plugin for viewing test results.