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

TestRail API returned HTTP 400("Field :results is a required field.")


I am getting below error while doing the automation for test rail using selenium. Not getting how to process further.

JSONArray results = new JSONArray();
List list = new ArrayList();
Map<String, Object> data = new HashMap<String, Object>();
data.put(“status_id”, new Integer(5));
data.put(“comment”, “This test worked fine!”);
data.put(“results”, list);
JSONObject runAPIResponse = (JSONObject) client.sendPost(“add_results/34”,list);


Hello Harsha,

Thanks for your post! We generally wouldn’t be able to provide support for specific automation code/scripts, but we’re happy to help with TestRail’s basic API methods and their formatting/syntax. Can you also include the full error response so that we can review this and help point you in the right direction?