0

I have just started using xk6-browser, and executed following test script.

import { chromium } from 'k6/x/browser';

export default function () {
  const browser = chromium.launch({ headless: false });
  const page = browser.newPage();

  page
    .goto('https://test.k6.io/', { waitUntil: 'networkidle' })
    .then(() => {
      page.screenshot({ path: 'screenshot.png' });
    })
    .finally(() => {
      page.close();
      browser.close();
    });
}

with the following command ./xk6-browser run k6-browser-testing-example.js

I got the following test results.

enter image description here

The test was executed with 1 virtual user and for one iteration. Why am I getting different average, min and max values for browser_dom_content_loaded?

Janesh Kodikara
  • 1,670
  • 1
  • 12
  • 23
  • The page loads 3 external resources, perhaps those are registered as a DOM load event too? (I'm guessing here). Can you try with `http://www.example.com`? – knittl Dec 27 '22 at 16:58
  • Average, max etc., were different for `browser_dom_content_loaded` and `browser_loaded`, even for `http://www.example.com`. – Janesh Kodikara Dec 28 '22 at 00:12
  • Apparently, there is a bug. https://github.com/grafana/xk6-browser/issues/518 – Janesh Kodikara Dec 29 '22 at 01:08
  • You can post the bug as a self-answer (quoting the important parts and proper reference of the source). – knittl Dec 29 '22 at 07:15

1 Answers1

0

Apparently, there is a known bug at the time of the testing.

Issue #518

Janesh Kodikara
  • 1,670
  • 1
  • 12
  • 23