Common Issues
Element Selection Problems
Element Selection Problems
Issue: Elements not found or interactions failingSolutions:
- Use browser dev tools to test selectors
- Add explicit waits for dynamic content
- Use more specific or stable selectors
- Check for iframe or shadow DOM elements
Timing and Race Conditions
Timing and Race Conditions
Issue: Tests failing due to timing issuesSolutions:
- Use
waitForSelector()instead of fixed delays - Wait for network requests to complete
- Use
waitForLoadState()for page readiness - Implement proper error handling and retries
Authentication and Session Issues
Authentication and Session Issues
Issue: Login failures or session timeoutsSolutions:
- Verify credentials are correct and active
- Handle multi-factor authentication scenarios
- Use session storage for authentication state
- Test login flow separately from main workflow
Performance and Timeout Issues
Performance and Timeout Issues
Issue: Tests timing out or running too slowlySolutions:
- Optimize page load performance
- Increase timeout values for slow operations
- Use parallel execution where possible
- Monitor and alert on performance degradation
Missing traces or videos
Missing traces or videos
Issue: A result has no trace or video, or some pages have no videoSolutions:
- 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 --recordornpx checkly trigger --record. See Viewing trace files. - Don’t rely on the
traceandvideooptions 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 setuse.traceanduse.video. - Open pages from the test’s own
pageorcontextfixture. Playwright records one video per page in that context. Pages from a context you create withbrowser.newContext()have no video. See Playwright’s videos guide. - 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
Wait Strategies
Wait Strategies
Error Recovery
Error Recovery