Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Can't figure out how to publish test results in Java using API


What is the structure to send multiple test results using the add_results API.

I have HashMap with one entry. Key is “results”, value is a List of HashMap objects. Each HashMap object contains two entries representing a result.

For example a result would be HashMap with:
“key” = “test_id”
“value” = {the test ID in test rails}

“key” = “status_id”
"value = {“5’ for failed, or “1” for passed”};

I’ve put all my results in a List, and the I’ve put this list in a HashMap with key “results”.

I get an API error:
APIException: TestRail API returned HTTP 400("Field :results cannot be empty but no valid tests or cases found")

What is the correct way to put the results? Your API example only show Javascript notation.


Please close. I found a solution in a different thread. I was using the wrong method


Hi Jesus,

Thanks for the update!