This thread is trying to answer question "How can I pass a unique identifier like a vuser ID to a playwright test using Artillery?"
In my case I'm loading a credentials file with a different user for each instance of playwright running, I can't seem to find a way to pass a unique identifier I can key off to playwright. I thought maybe it'd be possible through an environment variable but it doesn't seem to populate any before it executes
hi @xillian81 ๐ every Artillery VU has a unique ID associated with it. You can access that id inside a your Playwright test function through userContext.vars.$uuid
, where userContext
is the second argument for the Playwright test function. For example:
async function myTest(page, userContext) { console.log(userContext.vars.$uuid); await page.goto('https://www.artillery.io/'); }
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].