Hi all… Anyone have any idea how to see the body of a Request in the console of katalon?. When i do actions in the ui i need to see the body for all request.
You can certainly watch the traffic in the DevTools - but that’s not what you’re asking for
Not sure, I’ve never had this requirement. I can tell you though that Katalon will not have built-in functionality to support this.
One thing that you might be able to use: BrowserMob Proxy. I’ve used this to inject custom header data into each request, so it’s possible they have libs to record traffic as well.
@Russ_Thomas @Brandon_Hein Thanks for the answers. Use the ChromeDevTools plugin. It allowed me to visualize in console each type of HTTP request that is generated. What I can’t do is get the body of the requests. Will you have an idea how to do it?
In devtools, you can see request/result bodies as well, no problem. I thought you were wanting to somehow capture them in the Katalon scripts.
That was my thinking, too.
No, it’s not exactly “trivial” but it could be done.
If you know of a public/exposed endpoint, I could knock up a proof-of-concept (POC) but even that would need some work.
@ThanhTo is there anything you devs have that could be packaged up as a Custom Keyword?
Doesn’t seem so at the moment. I will delegate to the team for discussions.
I found a technical article which shows how to write a Java code which
- start BrowserMob proxy to capture all requests and responses, both of header and content.
- gets a HAR (HTTP Archive) file from BrowserMob proxy
- stop proxy once HAR has been obtained
- gets information out of the HAR to process further; filter portions; make assertions; save it into local files; print the headers and the content in the console, etc.
If someone can implement it as a set of Keywords as a Plugin, it may be welcomed. Can it be a new KSE feature?
Sorry, this article is in Japanese, and the sample codes in the article are not runnable, are just psuedo code fragments.
While we are on the subject of potential build-in keywords, here’s my topic on how I was able to use BrowserMob to add header data to each request:
@ThanhTo if you are going to investigate how to capture response data with BrowserMob, you may as well include how to include custom request data. This type of thing has been asked for by a few users in the past as well (specifically ModHeader functionality).