Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created by
brew bump
Created with
brew bump-formula-pr
.release notes
locator.locator
,locator.contentFrame
, andFrameLocator.locator
for powerful locator chaining and iframe handling.locator|frame|FrameLocator.getBy*
for targeting elements without relying on brittle CSS selectors.locator.filter
for filtering locators for more precise element targeting.locator.boundingBox
for retrieving element geometry.page.waitForResponse
for waiting on specific HTTP responses.Deprecations
A new summary mode
disabled
has been introduced to replace the "no summary" option #5118The
--no-summary
flag and its corresponding environment variableK6_NO_SUMMARY
have been deprecated in favor ofthe new
disabled
summary mode. This change unifies the configuration experience for controlling the end-of-test summary.You can now disable the end-of-test summary with either
--summary-mode=disabled
orK6_SUMMARY_MODE=disabled
.The
legacy
summary mode has been deprecated #5138The
legacy
summary mode was introduced in k6 v1.0, when the end-of-test summary was revamped with the addition of twonew modes:
compact
andfull
.Its purpose was to ease the transition for users who relied heavily on the old summary format.
However, we’ve now reached the point where it’s time to deprecate it.
The plan is to fully remove it in k6 v2.0, so please migrate to either
compact
orfull
to ensure readiness for thenext major release.
New features
locator.locator
#5073The
locator.locator
method allows you to define locators relative to a parent locator, enabling powerful locator chaining and nesting. This feature lets you create more precise element targeting by combining multiple selectors in a hierarchical manner.This nesting capability provides a more intuitive way to navigate complex DOM structures and serves as the foundation for other
locator
APIs in this release that require such hierarchical targeting.locator.contentFrame
#5075The browser module now supports
locator.contentFrame()
, which returns a new typeframeLocator
. This method is essential for switching context from the parent page to iframe contents.frameLocator
types target iframe elements on the page and provide a gateway to interact with their contents. Unlike regularlocator
s that work within the currentframe
context,frameLocator
s specifically target iframe elements and prepare them for content interaction.This approach is essential for iframe interaction because:
elementHandle
for iframe interactions is error-prone and can lead to stale references, whileframeLocator
provide reliable, auto-retrying approaches.Example usage:
frameLocator.locator
#5075We've also added
frameLocator.locator
which allows you to createlocator
s for elements inside an iframe. Once you've targeted an iframe withpage.contentFrame()
, you can use.locator()
to find and interact with elements within that iframe's content with theframeLocator
type.Example usage:
This functionality enables testing of complex web applications that use iframes for embedded content, payment processing, authentication widgets, and third-party integrations.
locator.boundingBox
#5076The browser module now supports
locator.boundingBox()
, which returns the bounding box of an element as a rectangle with position and size information. This method provides essential geometric data about elements on the page, making it valuable for visual testing, and layout verification.Using
locator.boundingBox()
is recommended overelementHandle.boundingBox()
because locators have built-in auto-waiting and retry logic, making them more resilient to dynamic content and DOM changes. While element handles can become stale if the page updates, locators represent a live query that gets re-evaluated, ensuring more reliable test execution.The method returns a rectangle object with
x
,y
,width
, andheight
properties, ornull
if the element is not visible:Locator filtering #5114, #5150
The browser module now supports filtering options for locators, allowing you to create more precise and reliable element selections. This enhancement improves the robustness of your tests by enabling you to target elements that contain or exclude specific text, reducing reliance on brittle CSS selectors.
locator.filter()
creates a newlocator
that matches only elements containing or excluding specified text.It's also possible to filter locators during their creation with options.
page.locator(selector, options)
creates page locators with optional text filtering:frame.locator(selector, options)
creates frame locators with optional text filtering:locator.locator(selector, options)
chains locators with optional text filtering:frameLocator.locator(selector, options)
create locators within iframe content with optional text filtering:frame.getBy*
,locator.getBy*
,frameLocator.getBy*
#5105, #5106, #5135The browser module now supports all
getBy*
methods onframe
,locator
, andframeLocator
types, expanding on thepage.getBy*
APIs introduced in v1.2.1. This enhancement provides consistent element targeting across all browser automation contexts, improving Playwright compatibility and offering more flexible testing workflows. The available methods on all types are:getByRole()
- Find elements by ARIA rolegetByText()
- Find elements by text contentgetByLabel()
- Find elements by associated label textgetByPlaceholder()
- Find elements by placeholder textgetByAltText()
- Find elements by alt textgetByTitle()
- Find elements by title attributegetByTestId()
- Find elements by data-testid attributeExamples across different types
This expansion makes k6 browser automation more versatile and aligns with modern testing practices where element targeting by semantic attributes (roles, labels, text) is preferred over fragile CSS and XPath selectors.
page.waitForResponse
#5002The browser module now supports
page.waitForResponse()
, which allows you to wait for HTTP responses that match specific URL patterns during browser automation. This method is particularly valuable for testing scenarios where you need to ensure specific network requests complete before proceeding with test actions.The method supports multiple URL pattern matching strategies:
This complements the existing
waitForURL
method by focusing on HTTP responses rather than navigation events, providing more granular control over network-dependent test scenarios.Thank you, @HasithDeAlwis, for contributing this feature.
UX improvements and enhancements
locator
) when elements aren't visible.route.continue
/fulfill
.k6 --help
output. Thank you, @Nishant891 for the change.Bug fixes
k6 login cloud
command. Thanks @indygriffiths for reporting it!k6
after a fix in v1.2.2.Any
.click
action in browser module when working iniframe
s and CORS.util
tomain
execution contexts in Chromium.Maintenance and internal improvements
{require|assert}.{Equal|NotEqual}
and equivalent calls.TestURLSkipRequest
for Chrome 140+.getBy*
andwaitForURL
implementations.Roadmap
Deprecation of First Input Delay (FID) Web Vital
Following the official web vitals guidance, First Input Delay (FID) is no longer a Core Web Vital as of September 9, 2024, having been replaced by Interaction to Next Paint (INP). The k6 browser module already emits INP metrics, and we're planning to deprecate FID support to align with industry standards.
FID only measures the delay before the browser runs your event handler, so it ignores the time your code takes and the delay to paint the UI—often underestimating how slow an interaction feels. INP captures the full interaction latency (input delay + processing + next paint) across a page’s interactions, so it better reflects real user-perceived responsiveness and is replacing FID.
Planned timeline
Action required
If you're currently using FID in your test scripts for thresholds or relying on it in external integrations, you should migrate to using INP as soon as possible.
This change ensures k6 browser testing stays aligned with modern web performance best practices and Core Web Vitals standards.
OpenTelemetry stabilization
We aim to stabilize OpenTelemetry's experimental metric output, promoting vendor neutrality for metric outputs. OpenTelemetry is becoming the standard protocol for metric format in observability. Our goal is to enable k6 users to utilize their preferred metric backend storage without any technological imposition.
View the full release notes at https://github.com/grafana/k6/releases/tag/v1.3.0.