I’ve been referred here from Katalon’s Twitter account so hoping someone in the community can help me.
I am trying to integrate Testrail with Katalon so that when we do automation testing, the test cases in the Testrail run have the results added in automatically. I’ve followed the Katalon Integration guide however it is not the best guide but I’ve managed to resolve most of the errors.
I am stuck on one error when trying to run the code which handles communication between Testrail and Katalon. Please see error below:
This is the Keyword for the update_run:
@Keyword def update_run(String id, String array) { def slurper = new JsonSlurper() def ro = new RequestObject('Update TestRail test run') ro.setRestRequestMethod('POST') ro.setRestUrl('https://%Testrail URL is here%/index.php?/api/v2/update_run/' + id) def httpheader = new ArrayList<TestObjectProperty>() httpheader.add(new TestObjectProperty( 'Content-Type', ConditionType.EQUALS, 'application/json')) httpheader.add(new TestObjectProperty( 'Authorization', ConditionType.EQUALS, '%CREDENTIALS HERE ENCODED%')) ro.setHttpHeaderProperties(httpheader) def body ="{'include_all': false,'case_ids': " + array + "}" WebUI.comment('body = ' + body) ro.setBodyContent( new HttpTextBodyContent(body, 'UTF-8', 'application/json')) def response = WSBuiltInKeywords.sendRequest(ro) return slurper.parseText(response.getResponseText())}
@AfterTestSuite
Def afterTestSuite() {
‘push results to testrail’
WebUI.callTestCase(findTestCase(’%replace this with path to your test case, for example:_nb/sync/testrail – update run tc results%’), [:], FailureHandling.CONTINUE_ON_FAILURE)
}
Please assist in a step by step guide on how you set up the value for the highlighted section above
Please also assist in clarifying this highlighted section. Will appreciate a step by step guide on generating credential in base64 and how it should appear in the code.
The path that you need to replace inside %% is where you created the automated script test case with the long code.
Locate the test case inside Test Cases, right click > Properties. The ID is what you want to copy and paste:
findTestCase(‘xxxxxxxxxxxxxxxxx’) where xxx is the ID you copied.