Rapise v5.1 - Enhanced REST Web Service Testing | Inflectra

Rapise v5.1 - Enhanced REST Web Service Testing

We're very excited about the next version of Rapise coming out later this week. It has many enhancements and improvements for testing the web, mobile and desktop applications which we'll be discussing in future blog articles. It also has some nifty new features to make the testing of REST web services even better.

Recording REST Tests

When you use Rapise to create web service tests for RESTful services, you use the built-in REST editor to set the URL, HTTP method, credentials and headers:

 

When you make the request, Rapise will report back the returned data in either JSON or XML format:

In addition, it returns the HTTP response headers from the web server:

You can then use the Record button to record this executed action in your test script:

In addition to this functionality that already exists in Rapise 5.0, We have now added some new features to the REST editor to make verification of the data even better.

Data Verification Enhancements

Previously with Rapise 5.0, you could automatically verify the entire JSON/XML data packet returned by clicking on the main Verify button. However this doesn't give you much control over which properties you want to actually tests for. That made it difficult to write checks for the items that should the same each time (number of items, the names and values) whilst at the same time, ignoring properties that change (e.g. session IDs, or the ID values of newly inserted items).

The new Validation option in Rapise 5.1 lets you specify specific properties to test for:

In this example we shall verify the name of the book and the name of the genre:

When we choose the option to Create Script, we will now get:

    var LibraryInformationSystem_Get_Books=SeS('LibraryInformationSystem_Get_Books');
    LibraryInformationSystem_Get_Books.SetRequestHeaders([{"Name":"Accept","Value":"application/json"},{"Name":"Content-Type","Value":"application/json"}]);
    LibraryInformationSystem_Get_Books.DoExecute();

    LibraryInformationSystem_Get_Books.DoVerify('LibraryInformationSystem_Get_Books Response', "[0].Name", "Hound of the Baskervilles");
    LibraryInformationSystem_Get_Books.DoVerify('LibraryInformationSystem_Get_Books Response', "[0].Genre.Name", "Murder & Mystery");

So instead of having to manual write verification steps in code after the recording, we now have an easy to use way of adding verification steps to our web service API tests.

rapise test automation api testing web services rest