What are the best tools for testing web services w

2020-05-26 11:35发布

问题:

I am new to testing of REST web services with JSON data format.

I tried SOUPUI, but unfortunately doesn't support JSON request.

I am now using the Chrome plugin for my tests, but I think it's not appropriate for test automation of these type of applications.

Does anybody know which tools are OK for this purpose?

回答1:

We're using RestClient for testing our Rest/JSON WebServices. It's very handy and easy to use



回答2:

A nifty framework/library for testing REST with json is "rest-assured"
http://code.google.com/p/rest-assured/

Inspired by BDD and Groovy ( but it's Java ) it makes it easy to test REST resources

given().
        param("key1", "value1").
        param("key2", "value2").
expect().
        body(containsString("OK")).
when().
        post("/somewhere");


And it's easy to work with JSON path

// Example with JsonPath
String json = get("/lotto").asString()
List<String> winnderIds = from(json).get("lotto.winners.winnerId");


Getting started is easy.
http://code.google.com/p/rest-assured/wiki/GettingStarted

Disclaimer
rest-assured is founded and managed by the Company I work for.



回答3:

One such tool is HttpMaster.

It's quite flexible regarding REST API testing and has good JSON/XML support. For advanced test scenarios, you can define response data validations and establish chains of multiple requests. The only possible drawback is that it runs on Windows only.



回答4:

There are few plugins which can be added for SOAP UI so that Json files can be accessed.