I am hoping to find a way for all active requests to complete in a k6 browser test. I have been trying to use the waitForNetworkIdle but that also listens for incoming requests and our site is very chatty with user tracking and monitoring so that is not an option. I want a function that monitors all active http requests and when the function gets calls it uses the current list of all active calls and waits for just those calls to finish before continuing. I was able to do this in playwright by adding requests listeners and then using those to keep an active list of requests but I cant seem to get the listeners to work in k6 browser so was wondering if anyone has tried doing something like this.
Hi @alexcentorbi07,
In the next k6 version, we’ll add page.on('request|response')
support. You can see the unpublished documentation here (note that there will also be a response
event). Do you think that will solve the issue?
Thanks
I believe that will! It looks like I should be able to set that up the same way I have the playwright one setup. Thank you!