Dear all,
I am reaching out for assistance with a specific behavior I’ve encountered in my K6 script that utilizes the experimental browser feature. In my setup, when executing the script, it bypasses the authentication step and automatically logs into the application. I suspect this automatic login is facilitated by OIDC (OpenID Connect) configurations.
To provide a bit more context, in my Playwright scripts, I am able to control this behavior by specifying launch options for Chromium, as shown below:
{
name: ‘chromium-local’,
use: {
…devices[‘Desktop Chrome’],
headless: false,
launchOptions: {
args: [‘–auth-server-whitelist=“*”’],
},
},
}
These settings effectively prompt for manual username and password input, preventing automatic sign-in. I am seeking to replicate this manual login process in my K6 script, ensuring it does not automatically authenticate. Below is the script where I wish to incorporate similar behavior:
import { browser } from ‘k6/experimental/browser’;
export const options = {
scenarios: {
ui: {
executor: ‘shared-iterations’,
options: {
browser: {
type: ‘chromium’,
},
},
},
},
}
export default async function () {
const page = browser.newPage();
try {
await page.goto(‘https://endurance.internal.epo.org/inbox-osa/inbox/’, { waitUntil: ‘networkidle’ });
page.screenshot({ path: ‘screenshots/screenshot.png’ });
} finally {
page.close();
}
}
I would greatly appreciate any guidance on configuring the K6 browser script to prompt for a username and password instead of auto-authenticating. Specifically, I’m looking for ways to pass Chromium launch arguments (similar to my Playwright setup) or any other recommended approach to achieve this.
Thank you in advance for your assistance.