Human Readable Tests

Significantly improve your test’s readability by working with C# objects. BELLATRIX can also generate test cases that are understandable for non-technical people.

10+ Supported Request Types

Request types which you can use directly with C# instead of working with JSON and XML.

Testing APIs can get quite complicated and unreadable if we keep lots of JSON and XML in our tests. BELLATRIX comes with 10 default request types which you can use directly with C# objects instead of JSON or XML. Moreover, the BELLATRIX API testing syntax makes reading and understanding the tests easier.
Making GET request and return a C# response object.

var request = new RestRequest("api/Albums/10");
var response = _apiClientService.Get<Albums>(request);

Change the title and create a PUT request.

var putRequest = new RestRequest("api/Albums/11");
getResponse.Data.Title = Guid.NewGuid().ToString();

Create a new album. Create a POST request and add the new object as a JSON body.

var newAlbum = CreateUniqueGeneres();
var request = new RestRequest("api/Genres");
var response = _apiClientService.Post(request);

Delete an existing artist.

var deleteRequest = new RestRequest($"api/Artists/{newArtist.ArtistId}");
var response = _apiClientService.Delete(deleteRequest);

All BELLATRIX client API methods have an async version. Your test should be marked as async and you should use the await operator.

var deleteRequest = new RestRequest($"api/Artists/{newArtist.ArtistId}");
var response = await _apiClientService.DeleteAsync<Artists>(deleteRequest);

Learn more

Responses as C# Objects

Automatically convert any XML or JSON response to a predefined C# object.

Making requests is not enough to test APIs. You also need to make validations of the responses. They are returned natively as JSON or XML. Some test frameworks are hard to use or read because they tend to use JSON and XML directly. The tests are polluted with low-level logic for converting text to language types such as boolean or numbers.

RestAssured Example Java

       .body("name",equalTo("Acme garage"))

The problem is that if the fields like “name”, “info.slots” or “info.status” change, your tests will start to fail. Moreover, you have to hard-code these values in each test and know them beforehand.

To solve these problems, BELLATRIX automatically converts any XML or JSON response to a predefined C# object. If there is a change in the response schema, you will see a meaningful error explanation and need to fix everything in one place.


var getUpdatedResponse = _apiClientService.Get<Albums>(request);
Assert.AreEqual(updatedTitle, getUpdatedResponse.Data.Title);

After the GET request, you can directly work with the Albums object. Of course, you can still access the original XML or JSON response body. The tests readability is further improved when you need to create or update objects. Instead of building yourself the JSON or all of the fields, you can do it directly by initializing the C# object.

RestAssured Example Java

JSONObject requestParams = new JSONObject();
requestParams.put("AlbumId", 23);
requestParams.put("Title", "Open Your Eyes");
requestParams.put("ArtistId", 26);
requestParams.put("ArtistName", "Guano Apes");
requestParams.put("AlbumName",  "Proud Like a God");
Response response ="api/Albums");


var newAlbum = new Albums
    Artist = guanoApesArtist,
    Title = "Open Your Eyes",
    Tracks = new List<Tracks>() { openYourEyesTrack },
var postRequest = new RestRequest("api/Albums");
var response = _apiClientService.Get<Albums>(request);

We work with C# objects and there are no hard-coded, copy-pasted strings.
Learn more

    Autogerated Test Cases

    You might be interested also in our online trainings

    Learn How to write automated tests for web, desktop, mobile, or API apps using WebDriver, Appium, SpecFlow, and other industry-leading tools/frameworks.

    See Our Trainings