-
Notifications
You must be signed in to change notification settings - Fork 241
Open
Labels
Area: browserThe browser moduleThe browser module
Description
What
Test scripts may fail or interact with stale elements after navigation or interactions that modify the DOM. Just waiting for the page to finish navigation isn't enough since modern websites perform async operations which could change the DOM after the navigation occurs.
Think about grafana.com. When the user logs into their account, sometimes they need to wait for their instance to spin up, so they should wait for the landing page rather than try to work with the navigation since they'll likely be hitting the loading page otherwise.
Solution
Wait for specific elements to be available before continuing the test script. Use k6's locator
APIs such as wait
or page.waitForSelector
.
This is critical when dealing with SPAs or dynamic content.
Metadata
Metadata
Assignees
Labels
Area: browserThe browser moduleThe browser module