Open jsaujla opened 2 days ago
For your eyes @inancgumus @ankur22 đź‘€
Hi @jsaujla,
Thanks for opening an issue.
please correct me if i've missed anything, but it sounds like you would like to time the individual navigations within a single test iteration, correct?
Would something like this suffice when working with custom metrics?:
import { browser } from 'k6/x/browser/async';
import { Trend } from 'k6/metrics';
export const options = {
scenarios: {
ui: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium',
},
},
},
},
}
const launchTrend = new Trend('Launch');
const loginTrend = new Trend('Testk6_Login');
const logoutTrend = new Trend('Testk6_Logout');
export default async function() {
const context = await browser.newContext();
const page = await context.newPage();
try {
var start = Date.now();
await page.goto('https://test.k6.io/', { waitUntil: 'networkidle' });
await Promise.all([
page.waitForNavigation(),
page.locator('a[href="/my_messages.php"]').click(),
]);
var end = Date.now();
launchTrend.add(end - start);
await page.locator('input[name="login"]').type('admin');
await page.locator('input[name="password"]').type("123");
start = Date.now();
await Promise.all([
page.waitForNavigation(),
page.locator('input[type="submit"]').click(),
]);
var end = Date.now();
loginTrend.add(end - start);
start = Date.now();
await Promise.all([
page.waitForNavigation(),
page.locator('input[type="submit"]').click(),
]);
var end = Date.now();
logoutTrend.add(end - start);
} finally {
await page.close();
}
}
When running it locally, the summary will show the custom metrics like so:
Launch......................: avg=2375 min=2375 med=2375 max=2375 p(90)=2375 p(95)=2375
Testk6_Login................: avg=479 min=479 med=479 max=479 p(90)=479 p(95)=479
Testk6_Logout...............: avg=448 min=448 med=448 max=448 p(90)=448 p(95)=448
Feature Description
k6/browser does not provide feature to capture individual transaction response time.
Below are some examples of true client (browser based) performance tests:
Suggested Solution (optional)
Below is an example of JMeter WebDriver Plugin script (I executed the script with loop count 10):
Below is an overview of html output report:
Already existing or connected issues / PRs (optional)
No response