4

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.

ohthepain
  • 2,004
  • 3
  • 19
  • 30

2 Answers2

0

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.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I can't find any plugins that will let us vary our json rpc args. Only plugins for parsing the returned json. – ohthepain Dec 05 '13 at 09:35
0

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.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • Does it have any way of generating rpc json, or would we have to write that ourselves? It seems to have pretty good facilities for parsing json. – ohthepain Dec 05 '13 at 09:30
  • @ohthepain: it doesn't have anything built-in. What you would do is write keywords in python (or java, if you're a java shop), and then call those keywords from your test suite. – Bryan Oakley Dec 05 '13 at 11:50
  • The recent versions of the Jenkins plugin cause a Content-Security-Policy error if you have SSL enabled. There are some solutions that work, such as [this change to Jenkins Content Security Policy](https://stackoverflow.com/questions/37618892/jenkins-content-security-policy). – DDay Jun 24 '19 at 20:31