Skip to main content

Common Issues

Issue: Elements not found or interactions failingSolutions:
  1. Use browser dev tools to test selectors
  2. Add explicit waits for dynamic content
  3. Use more specific or stable selectors
  4. Check for iframe or shadow DOM elements
Issue: Tests failing due to timing issuesSolutions:
  1. Use waitForSelector() instead of fixed delays
  2. Wait for network requests to complete
  3. Wait for the element you need with a web-first assertion instead of waitForLoadState(), which can time out on pages with slow third-party scripts. See Intermittent failures
  4. Implement proper error handling and retries
Issue: Login failures or session timeoutsSolutions:
  1. Verify credentials are correct and active
  2. Handle multi-factor authentication scenarios
  3. Use session storage for authentication state
  4. Test login flow separately from main workflow
Issue: Tests timing out or running too slowlySolutions:
  1. Optimize page load performance
  2. Increase timeout values for slow operations
  3. Use parallel execution where possible
  4. Monitor and alert on performance degradation
Issue: A result has no trace or video, or some pages have no videoSolutions:
  1. Check whether the run failed. Scheduled runs keep the trace and video only when the check fails. Runs from the editor keep them whether the check passes or fails, and so do runs you record with npx checkly test --record or npx checkly trigger --record. See Viewing trace files.
  2. Don’t rely on the trace and video options in your Playwright configuration. Browser checks ignore them, so you can’t keep artifacts for passing scheduled runs or turn off video recording. To control them, use a Playwright Check Suite and set use.trace and use.video.
  3. Open pages from the test’s own page or context fixture. Playwright records one video per page in that context. Pages from a context you create with browser.newContext() have no video. See Playwright’s videos guide.
  4. Set a test timeout below the 240-second run limit, for example test.setTimeout(210000). A test that times out on its own test timeout keeps its trace and video. A test still running when the check reaches the run limit is stopped without them. See Browser check timeouts.

Error Handling and Debugging

Intermittent failures

A check that passes most of the time and sometimes fails usually has a timing problem in the script: it acts before the page is ready, waits for something that doesn’t always happen, or matches an element the user can’t see. Checkly runs each Browser check with one worker, no Playwright retries and Playwright’s default test timeout of 30 seconds, unless you set your own with test.setTimeout(). Each run starts a new browser. Start from a failed result. Read the error and its call log, then open the trace and video to see what the page showed when the step failed. Scheduled runs keep the trace and video only when the check fails. See Viewing trace files.
Issue: The check fails with an unexpected value, or with page.waitForTimeout: Test timeout of 30000ms exceeded.A fixed wait with page.waitForTimeout() is either too short or too long. When the page is slower than the wait, the next step reads the page too early:
When the wait is longer than the time left, the test times out during the wait.Solutions:
  1. Remove page.waitForTimeout() calls.
  2. Use web-first assertions and locator actions. They wait until the element is ready, up to their timeout:
See Waits and timeouts.
Issue: page.goto: Test timeout of 30000ms exceeded. with waiting until "load" in the call log, or page.waitForLoadState: Test timeout of 30000ms exceeded.page.goto() waits for the page’s load event by default. The load event waits for every script and image on the page, including third-party tags such as analytics and marketing pixels. If one of them hangs, load doesn’t fire, even when your page has already rendered. waitForLoadState('networkidle') waits until there have been no network requests for 500 ms, so a page that polls an API or keeps a request open never reaches it. Third-party scripts can be slow from one location and fast from another, which makes the failure look random.In the trace, the network tab lists the request that never finished.Solutions:
  1. Don’t wait for networkidle. Playwright discourages it.
  2. Navigate with waitUntil: 'domcontentloaded', then wait for the element you need:
  1. If a third-party script isn’t part of what you monitor, you can block it with page.route(). Your check then won’t notice when that script breaks your page. See Avoid network interception in synthetic monitoring.
Issue: A test fails because of what an earlier test did, and failed results have no videoWhen you create a context or page with browser.newContext() in test.beforeAll(), all tests in the file share it, including cookies, local storage and the current URL. A test can then pass or fail depending on the tests before it. Playwright also records no video for pages in a context you create yourself.Solutions:
  1. Use the built-in page fixture. Each test gets a new context and page, and Playwright records the video:
  1. To share a login between tests, save the storage state and load it in each test instead of sharing the page. See Playwright authentication.
Issue: strict mode violation: ... resolved to 2 elements, or a click times out with element is not visible in the call logA locator that matches several elements fails an action in strict mode:
Pages often contain hidden copies of an element, such as a mobile menu or the entries of another month in a calendar. Adding .first() silences the strict mode error but can pick the hidden copy. Playwright then waits for that element to become visible until the test times out.Solutions:
  1. Use role-based locators. getByRole() ignores hidden elements by default:
  1. Scope the locator to the visible part of the page, for example page.locator('main').locator('.submit').
  2. Keep only visible matches with .filter({ visible: true }). This needs Playwright 1.51 or later, so runtime 2025.04 or later.
See Handling multiple matching elements.
Issue: page.goto: net::ERR_ABORTED, or the step after a click fails because the page changedSome pages redirect a moment after they load, for example to a login or consent page. When the script clicks or navigates just before the redirect, the redirect cancels that navigation. Whether the script wins the race depends on timing, so the check fails only sometimes.Solutions:
  1. Wait for the final URL before the next step:
page.waitForURL('**/final') works too.
Issue: The run fails with browserType.launch: Target page, context or browser has been closedThe browser stopped while it was starting, before your test code ran. The result has no video.Solutions:
  1. Check whether the next runs passed. If the check uses retries, a failed run is retried: Checkly runs the whole check again with a new browser.
  2. If the error keeps coming back, contact support@checklyhq.com with a link to the failed result.
Issue: The check fails more often since its runtime changed, for example after a new account default runtimeEach runtime comes with its own Playwright and Chromium versions, so a runtime change can change timing and behavior.Solutions:
  1. Run the check on the previous runtime and compare the results. With the CLI, set runtimeId on the check, for example runtimeId: '2025.04', and run npx checkly test --verbose. The run log names the runtime it used, for example Creating runtime version 2025.04. To do this in the web app, see Overriding runtimes for specific checks.
  2. If the check passes on the previous runtime and fails on the new one, compare the traces of both runs to find the step that behaves differently.
Issue: The check fails from one location and passes from othersA third-party script, CDN or network path can be slow from one region only. Compare failed and passing results from different locations, and look at the network tab in the trace for slow requests. See Managing false positives for retries and multi-location setups that reduce alerts for regional problems.