A k6 module for browser automation and end-to-end web testing with Playwright-like APIs and Chrome DevTools Protocol.
xk6-browser is a browser automation module for the k6 load testing platform. It adds browser-level APIs to k6, enabling end-to-end web testing and frontend performance metric collection via the Chrome DevTools Protocol. It solves the problem of integrating browser interactions and user experience measurements into load and performance tests.
Performance engineers and developers using k6 for load testing who need to simulate real user browser interactions and measure frontend performance as part of their tests.
Developers choose xk6-browser because it seamlessly integrates browser automation into k6's existing testing framework, offers rough Playwright API compatibility for easier adoption, and focuses on test stability with non-flaky selectors and auto-waiting.
The browser module adds support for browser automation and end-to-end web testing via the Chrome Devtools Protocol to k6.
Works directly with k6's VU executors, scenarios, and metrics, allowing browser automation to be embedded into existing load tests without extra setup, as it's now a core module from k6 v0.52.0.
Offers rough API compatibility with Playwright, reducing the learning curve for users familiar with its patterns, as stated in the project goals.
Incorporates non-flaky selectors and auto-waiting for actions, similar to Playwright, to improve reliability and minimize flaky tests in load testing scenarios.
Collects web performance data like page load times and resource timings during k6 tests, enabling comprehensive user experience measurement alongside backend performance.
Currently only supports Chromium-compatible browsers, with Firefox and WebKit support still in development, restricting cross-browser testing capabilities as noted in the README.
The API is still transitioning, leading to potential breaking changes and inaccurate documentation snippets, as warned in the README's additional resources section.
Tightly coupled with k6, requiring adoption of the k6 platform for load testing, which adds complexity for teams not already invested in the k6 ecosystem.
Browser automation adds significant resource overhead compared to pure protocol-level k6 tests, which may not be suitable for high-scale load testing without careful planning.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.