Hello everyone and happy new year !
I am working on a project, but often got the following error “navigation interrupted by another one”.
The console then outputs as shown below :
Here’s the full code (except confidential URL ) :
import launcher from 'k6/x/browser';
import { check, sleep, async, } from 'k6';
/****************************************************************************************/
/****************************************************************************************/
// Pacing : Nouvelle itération toutes les 10sec
export default function() {
const browser = launcher.launch('chromium', { headless: false });
const context = browser.newContext({ignoreHTTPSErrors: false });
let page = context.newPage();
// Start transaction : S_***_01 URL
//--> Navigation vers l'url
page.goto('URL', { waitUntil: 'networkidle' });
// End transaction : S_***_01 URL
// Start transaction : S_***_02 Fermer Popup
//--> Cliquer sur le bouton de fermeture
page.click('id=close-modal');
// End transaction : S_***_02 Fermer Popup
// ** wait 2sec **
sleep(2);
//--> Check button with id 'status-ligne0' contains "En serv."
var btn1Txt = page.innerText('id=status-ligne0')
if (btn1Txt == "En serv."){
console.log("success");
}else {
console.log("fail");
}
//--> Click "En serv." button
page.click('id=status-ligne0');
// ** wait 500 millisec **
sleep(0.5);
// --> Check 'span[class=dash]' button contains "-"
var btn2Txt = page.innerText('span[class=dash]');
if (btn2Txt == '-'){
console.log("Success");
}else {
console.log("Fail");
}
// --> Click 'span[class=dash]' button
page.click('span[class=dash]');
//--> Scroll vertically by 855 px
page.mouse.wheel(0, 855);
// ** wait 2sec **
sleep(2);
// --> Check 'acts-block' div contains "Actes / outils conseillers" text
var div1Txt = page.innerText('id=acts-block');
if (div1Txt == 'Actes / outils conseillers'){
console.log("Success");
}else {
console.log("Fail");
}
// --> Click "achats" button
page.click('id=btn-Achats');
// --> Click "Acquérir une offre" button
// Can't find this button yet :/
// Start transaction : S_H2H_07 MoyenContact
//-->
// End transaction : S_H2H_07 MoyenContact
// Start transaction : S_H2H_08 Fermer
//-->
// End transaction : S_H2H_08 Fermer
page.close();
browser.close();
}
So I was wondering where could this error come from, and how to solve it
Echape