-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
k6/browser does not support true client performance testing #4036
Comments
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 |
Thanks for the advise. Yes, I am able to implement true client performance testing checks.
Below is an output I wanted to see. It's good: Would you please advise how to remove (or separate) other Custom Metrics (browser_data_received, browser_web_vital_ttfb, etc.) from the 4 I added? I don't think these are relevant in terms of individual navigation checks. |
Hi @jsaujla, Happy to hear that the solution worked for you.
There isn't a way to not emit the build in metrics. In the tool that you are working with to store and display the results, is it not possible to ignore the metrics that you are not interested in? |
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
The text was updated successfully, but these errors were encountered: