Testing download endpoints in k6 browser

I need to test a specific download endpoint that works with a browser cookie that is http only (I am forced to use k6 browser). THis endpoint downloads a pdf file and we are interested on load testing that url. Actually, I have tried to access the url by using the goTo() function but whenever the response happens it shows a file location popup that I cant handle (it does not work as it does in pure playwright which handles the pop up by itslef). Is there another way? we still do not have access to the request api or anything similar.
Also is there a way to check if the download request just finished, like the waitForResponse() in playwright? I have tried using the wait for navigation but it doesn’t work

Hey @neurohypophysis

Unfortunately we do currently not have support for the download feature as it is implemented in PW. See this issue for instance.

Nevertheless you mention that you want to load test this endpoint, which is not the focus of k6 browser. But you also mention that you are forced to use k6 browser. Can you clarify why you are forced? If the file itself can be ignored, and just want to test the endpoint response itself, this might be better suited for k6’s HTTP module.

1 Like