Hello,
I am trying to run front end load test with 100 users but it is encountering the following errors
level=error msg=“Uncaught (in promise) waiting for navigation: timed out after 1m0s” executor=constant-vus scenario=ui
level=error msg=“process with PID 68 unexpectedly ended: signal: killed” category=browser elapsed=“0 ms” source=browser
The scenario I want to test involves a user logging in and then remaining idle for 60 minutes. I am attempting to run this with 100 users, but it is failing.
Note: The script works as expected with 10 users, but it fails when the number of users exceeds 10.
Kindly find the script I am using for this scenario and provide a solution.
import { browser } from 'k6/experimental/browser';
import { SharedArray } from 'k6/data';
import { check, sleep } from 'k6';
import papaparse from './testData/papaparse.js';
const userNames = new SharedArray('teamManager_users', function () {
return papaparse.parse(open('./testData/mrUserNames.csv'), { header: true }).data;
});
const randomUser = userNames[Math.floor(Math.random() * userNames.length)];
const mrTeamManagerUser = randomUser.Teammanager_User
export const options = {
scenarios: {
ui: {
executor: 'constant-vus',
vus: 100,
duration: '1h15m',
options: {
browser: {
type: 'chromium',
},
},
},
},
thresholds: {
checks: ['rate==1.0'],
},
};
export default async function() {
const page = await browser.newPage();
try{
await page.goto('https://abcd.com');
await page.locator('#txtUserID').fill(mrTeamManagerUser)
await page.locator('#txtPassword').type('@Rules1#')
const loginButton = page.locator("#sub");
await Promise.all([page.waitForNavigation({
timeout: 60000
}), loginButton.click()]);
await page.waitForSelector('div.content-item.content-field.item-1 h2', { timeout: 10000 });
const h2Elements = await page.evaluate(() => {
return Array.from(document.querySelectorAll('h2')).map(el => el.textContent);
});
// console.log('All H2 Texts:', h2Elements);
const worklistText = h2Elements.find(text => text.includes('Worklist for '));
// console.log('Extracted Worklist Text:', worklistText);
check(worklistText, {
'Worklist text is correct': (text) => text !== undefined,
});
sleep(3600);
const loginPage = page.locator('#login');
check(loginPage, {
'Navigated to login page after logout': (el) => el.isVisible(),
});
} finally {
await page.close()
}
}```