Hi there,
I’m trying to run a simple k6 browser test within windows wsl.
But it can’t find the chromium browser, although it is installed. I also tried with google-chrome.
ls -l /usr/bin/chromium-browser /usr/bin/google-chrome
-rwxr-xr-x 1 root root 2408 Sep 18 2020 /usr/bin/chromium-browser
lrwxrwxrwx 1 root root 31 Oct 7 10:50 /usr/bin/google-chrome -> /etc/alternatives/google-chrome
Launching the browser from the same shell I launch k6 works!
The output from k6:
me@pc:~/code$ k6 run main.js
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io
execution: local
script: main.js
output: -
scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop):
* ui: 1 iterations shared among 1 VUs (maxDuration: 10m0s, gracefulStop: 30s)
✓ checks...............: 0.00% ✓ 0 ✗ 0
data_received........: 0 B 0 B/s
data_sent............: 0 B 0 B/s
iteration_duration...: avg=24.62µs min=24.62µs med=24.62µs max=24.62µs p(90)=24.62µs p(95)=24.62µs
iterations...........: 1 3091.811338/s
running (00m00.0s), 0/1 VUs, 0 complete and 1 interrupted iterations
ui ✗ [======================================] 1 VUs 00m00.0s/10m0s 1/1 shared iters
ERRO[0000] error building browser on IterStart: finding browser executable: k6 couldn't detect google chrome or a chromium-supported browser on this system at default (file:///home/xxx/code/main.js:21:16(0))
The script:
import { browser } from 'k6/browser';
export const options = {
scenarios: {
ui: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium',
},
},
},
},
thresholds: {
checks: ['rate==1.0'],
},
};
const BASE_URL = "http://localhost:3000";
export default async function () {
const context = await browser.newContext();
const page = await context.newPage();
try {
await page.goto(`${BASE_URL}/main/home`);
} finally {
await page.close();
}
}