Skip to content

Conversation

@TheComeUpCode
Copy link
Contributor

@TheComeUpCode TheComeUpCode commented Oct 30, 2025

Added guidance on handling stale or dynamic elements in k6 browser tests.

What?

Clarifies how to handle asynchronous DOM updates in k6 browser tests. Explains that waiting for navigation alone is insufficient and recommends waiting for specific elements using locator APIs like wait or page.waitForSelector.

Checklist

  • I have used a meaningful title for the PR.
  • I have described the changes I've made in the "What?" section above.
  • I have performed a self-review of my changes.
  • I have run the npm start command locally and verified that the changes look good.
  • I have made my changes in the docs/sources/k6/next folder of the documentation.
  • I have reflected my changes in the docs/sources/k6/v{most_recent_release} folder of the documentation.
  • I have reflected my changes in the relevant folders of the two previous k6 versions of the documentation (if still applicable to previous versions).
  • I have made my changes in the docs/sources/k6/next folder of the documentation.

Related PR(s)/Issue(s)

Closes #2081

Added guidance on handling stale or dynamic elements in k6 browser tests.
@TheComeUpCode TheComeUpCode requested review from a team and heitortsergent as code owners October 30, 2025 22:22
@TheComeUpCode TheComeUpCode requested review from AgnesToulet and mstoykov and removed request for a team October 30, 2025 22:22
Added example code for waiting on DOM changes in k6 tests.
@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

💻 Deploy preview deleted (Create documentation for handling stale elements in k6).

…it-dom-changes.md

Co-authored-by: Ankur <ankur.agarwal@grafana.com>
@TheComeUpCode TheComeUpCode merged commit 4ade464 into main Oct 31, 2025
9 checks passed
@TheComeUpCode TheComeUpCode deleted the BA/docs-wait-dom-changes branch October 31, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Waiting for elements after DOM changes

2 participants