Playwright output as HAR file #2199
Replies: 5 comments 3 replies
-
hi @roydekleijn 👋 - I'd have to check but it may not be working because Artillery creates a separate browser for each virtual user, and each of those browsers is trying to write to the same file. Is there a particular reason you want to save requests from all VUs? |
Beta Was this translation helpful? Give feedback.
-
Hello, Thanks! If I'm right, it's more of an issue for the Playwright-team then? Can we somehow manage that a separate file is created per Vuser? I will describe my use case a bit more,
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the details @roydekleijn. If I understand correctly you need the HAR files to get performance metrics for the API routes that are triggered by actions performed by the Playwright script? That's possibly something we could implement natively in our integration and provide those metrics alongside other metrics reported by Artillery. In the meantime, I think you can use the First make sure that your Playwright test function is passed the async function myPlaywrightTestFunction(page, userContext) {
} And then add this as the first line of your Playwright test function: await page.routeFromHAR(`/tmp/playwright-har-${userContext.vars.$uuid}.har`, {
update: true
}); This makes use of the unique This should produces a bunch of HAR files looking like this: |
Beta Was this translation helpful? Give feedback.
-
Awesome, this is what I was looking for. I will create a small utility to process the files and report the timings, Thanks! It would be awesome is this will become part of Artillery! |
Beta Was this translation helpful? Give feedback.
-
Great, glad that's what you were looking for! and thanks for the idea :) |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm running some Playwright flows with artillery. I try to save the output (requests made by the browser) into a HAR file. This is fine when running 1 session/arrival/vusers, but doesn't work when running multiple sessions/arrivals.
This is the Playwright config I'm using:
My question is, how can I combine all the output in a single HAR file, OR how can I create 1 HAR file per session/arrival/vusers ? Which then can be processed later on.
Happy to collaborate on this!
Roy
Beta Was this translation helpful? Give feedback.
All reactions