HttpMethod in Test Listeners

Hello, I would like to have some code that sends http post to update existing Jira ticket. (As far as know, although Katalon has the Jira integration, it still requires manual work), so I want this to be automated, so at the end of every test, through the listener, update the jira ticket.

I have tried to use external libraries(jersey client) although there was an issue with the import statement which I couldn’t figure out. (but I know that this code is working fine code since this was what I implemented in my other automation framework)

But since Katalon already supports web service tests, it should already have some api that I can just leverage and I found
RequestObject
RestRequestObjectBuilder
ResponseObject.

However, I can’t understand how I can use this, since there is no sample, or tutorial page for this. So, I think it would be good if we have some documentation on Request/Response object usage like other libraries(Jersey, Apache, Spring), this will be great since I don’t have to use external libraries.

Thank you

Just to inform you, Apache HttpClient is the one you should choose. I have ever done https://hc.apache.org/httpcomponents-client-ga/quickstart.html in my test case with success. Have a look at %KatalonStudioInstalledDirectory%/plugins directory. In there you can find org.apache.httpcomponents.httpclient_x.x.x.jar and more which Katalon Studio itself depends upon. You can import the Apache HttpClient package and reuse it in your test cases.

So, I think it would be good if we have some documentation on …

Well, I suppose Katalon Team would not be willing to write a document about its external dependencies. I would not argue about it. I would just reuse the bundled jars.

You can also add your external dependencies into Katalon Studio:
https://docs.katalon.com/display/KD/External+Libraries

However, some jars has its own dependencies. If the jar of your choice has a complexed external dependencies it could be a nightmare. I do not know about Jersey at all. Having a look at the page https://jersey.github.io/documentation/latest/modules-and-dependencies.html, I suppose Jersey is too big to bring into Katalon Studio which do not provide you any automatic dependency management like Maven.

kazurayam said:

Just to inform you, Apache HttpClient is the one you should choose. I have ever done https://hc.apache.org/httpcomponents-client-ga/quickstart.html in my test case with success. Have a look at %KatalonStudioInstalledDirectory%/plugins directory. In there you can find org.apache.httpcomponents.httpclient_x.x.x.jar and more which Katalon Studio itself depends upon. You can import the Apache HttpClient package and reuse it in your test cases.

So, I think it would be good if we have some documentation on …

Well, I suppose Katalon Team would not be willing to write a document about its external dependencies. I would not argue about it. I would just reuse the bundled jars.

Thank you for the thought,
I didn’t know Katalon itself is coming with Apache Httpclient, I think I can just use this instead of using Jersey.

Katalon Studio API Testing feature can help to create/update the issue easily. All what you need is creating new WebService object, setting url (from Jira API endpoints) and specify the body (as a json in my example). All the information in the json Body can be parameterized so you can create the WebService object dynamic and reuse with different data.

Screen Shot 2018-05-09 at 13.45.35.png

1 Like

Trong,

Interesting!