Is there a way to get request body in performance results?

I started using xk6-browser in order to get performance metrics for web pages. These pages make many graphql calls to get data and render in page. I used groups and thresholds and I am able to see the results in a csv file. Great! However, in csv file, under url column, I can see that the api request was to a graphql portal. Is there a way to see the query? what was the request body?

Hi José, welcome to the forum :slight_smile:

Unfortunately, this is currently not possible with xk6-browser.

In the future we aim to support features like request and response interception, which would allow you to log the used query or request body. See this article for how this works with Playwright or Puppeteer, and we’re aiming for a similar API. Or via the Route API, for which we have an open issue you can follow.

Note that you wouldn’t be able to see this in a CSV output file even if this was implemented, but you would be able to log it to stdout and save it in a file with k6’s run --console-output option.