Hi,
My K6 version 0.55
and the below script is working fine.
import {browser} from ‘k6/experimental/browser’;
import {sleep} from ‘k6’;
export const options = {
scenarios: {
perftest: {
executor: ‘per-vu-iterations’,
options: {
browser: {
type: ‘chromium’,
},
},
},
},
}
export default async function(){
const page = browser.newPage();
try{
const response = await page.goto(‘https://testorg.stotte.no’,{waitUntil:‘networkidle’});
sleep(4);
console.log(‘Status Code:’, response.status());
}finally{
page.close();
}
}
However if I change the browser import statement to k6/browser then I see below error
ERRO[0001] Uncaught (in promise) TypeError: Object has no member ‘close’
running at default (file:///C:/Users/UX510727/K6/PageLoad1.js:24:15(33)) executor=per-vu-iterations scenario=perftest
data_sent............: 0 B 0 B/s
iteration_duration...: avg=506µs min=506µs med=506µs max=506µs p(90)=506µs p(95)=506µs
iterations...........: 1 0.741877/s
vus..................: 1 min=1 max=1
vus_max..............: 1 min=1 max=1
As per latest version update, I should be able to use k6/browser right ? please help me.
2 posts - 2 participants