Testing witth Slow Loading Sites

Slow-loading websites can cause test failures in CheckView if elements are not fully loaded before the bot attempts to interact with them. Fortunately, CheckView’s Advanced Settings for test flows allow you to customize timing parameters, ensuring your tests run smoothly even on slower sites.

Common Issues

When testing slow-loading sites, you might encounter:

  • Element Timeout Errors: The bot cannot find an element because it hasn’t loaded yet.
  • Step Failures: Steps like form submissions, clicks, or assertions fail due to incomplete page rendering.
  • Flaky Tests: Intermittent failures caused by varying load times between test runs.

Using Advanced Settings

The Advanced Settings section in CheckView’s Test Flow Editor provides precise controls to handle slow-loading sites. Here’s how to use them effectively:

  1. Adjust Step Delay
    • What It Does: Sets a delay between each test step.
      • Default: 1 second.
      • Range: 0–5 seconds.
    • When to Use: Increase the delay if your site consistently takes longer to process actions like form submissions or navigation. Use a higher delay for workflows with heavy backend processing or dynamic content.
    • How to Set:
      • Open the Test Flow Editor.
      • Navigate to the Advanced Settings tab.
      • Adjust the Step Delay slider to your desired value.
    • Pro Tip: Start with small increments (e.g., 2–3 seconds) and test again. Avoid unnecessarily long delays, which can increase test duration without added benefit.
  2. Modify Element Timeout
    • What It Does: Specifies how long the bot waits for an element to load before interacting with it.
      • Default: 10 seconds.
      • Range: 1–30 seconds.
    • When to Use: Increase the timeout for pages with slow-rendering elements, such as large images, JavaScript-heavy content, or external API calls. Decrease the timeout to optimize test runs on faster-loading sites.
    • How to Set:
      • Open the Test Flow Editor.
      • Navigate to the Advanced Settings tab.
      • Adjust the Element Timeout value to your preferred setting.
    • Pro Tip: Use this setting in conjunction with Step Delay for workflows with both slow navigation and slow-loading elements.
  3. Add Pause Steps for Specific Delays
    • What It Does: Inserts a delay (in milliseconds) at specific points in the test flow.
    • When to Use: Use Pause Steps if only certain steps (e.g., page reloads, AJAX calls) require extra time, rather than increasing the overall step delay. Add pauses before actions like asserting element visibility or clicking dynamic buttons.
    • How to Set:
      • In the Test Flow Editor, add a Pause Step where needed.
      • Set the delay in milliseconds (e.g., 3000 for a 3-second pause).
    • Pro Tip: Combine Pause Steps with conditional logic (e.g., assertions) to verify elements are ready before proceeding.

Best Practices

  1. Identify Bottlenecks:
    • Use the Test Recording feature to pinpoint steps that fail due to slow-loading elements.
    • Analyze the HAR file (downloadable from the test results) to identify requests with high load times.
  2. Optimize Timing Without Overcompensating:
    • Avoid setting excessively high delays or timeouts across the entire test flow. Focus on steps where delays are genuinely needed.
  3. Use Assertions for Element Readiness:
    • Replace static delays with assertions to ensure elements are loaded before interacting with them.
    • Examples:
      • Use Assert Element Is Visible to confirm an element has appeared.
      • Use Assert Element Text Contains to verify dynamic content is loaded.
  4. Prioritize Critical Flows:
    • If slow-loading elements are non-critical (e.g., analytics scripts, background images), focus your test on workflows that directly impact user experience (e.g., checkout, form submissions).
  5. Test Across Time Periods:
    • Run tests at different times to account for fluctuations in site performance, such as increased server load during peak hours.

Slow-loading sites require thoughtful adjustments to timing and step configuration to ensure reliable test results. By using CheckView’s Advanced Settings, such as Step Delay, Element Timeout, and Pause Steps, you can tailor test flows to handle slow-performing elements effectively.