You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting 'TestRail API returned HTTP 400("Field :case_id is not a valid ID.")
It should be getting id="188056" set by the TestRails annotation and i'm not sure if it's just not getting that at all and where it is getting case_id from even because I only use caseId it my test.
When using add_result_for_case, you should be passing the test run ID and case ID as parameters in your request. Based on your code, you are submitting the suite ID instead of the run ID and this appears to be the cause of the error message.
If you continue to have issues submitting API requests, please reach out to the support team at [email protected].
The issues for this repository are primarily used for reporting issues with the TestRail API bindings, or other code inside this repository.
Getting 'TestRail API returned HTTP 400("Field :case_id is not a valid ID.")
It should be getting id="188056" set by the TestRails annotation and i'm not sure if it's just not getting that at all and where it is getting case_id from even because I only use caseId it my test.
Screenshot https://monosnap.com/file/ooAnQRTmQZw8bDA7lMT79pBXuEMqNz
Im using the instructions here https://www.swtestacademy.com/integrate-test-automation-results-with-testrail-testng/
Here is the code:
}
@AfterMethod
public void afterTest(ITestResult result, ITestContext ctx) throws IOException, APIException {
Map data = new HashMap();
if(result.isSuccess()) {
data.put("status_id",1);
}
else{
data.put("status_id",5);
data.put("comment", result.getThrowable().toString());
}
String caseId = (String)ctx.getAttribute("caseId");
Long suiteId = (Long)ctx.getAttribute("suiteId");
client.sendPost("add_result_for_case/"+suiteId+"/"+caseId,data);
}
@testrails(id="188056")
@test (groups = "1")
public void onBoarding() throws InterruptedException {
test steps ommited
}
}
The text was updated successfully, but these errors were encountered: