Skip to main content

Configure Page Load Strategy

Ines avatar
Written by Ines
Updated over 3 weeks ago

Prerequisites

  • Thunder Code account

  • Completed Onboarding Process

  • An existing Test Project

What Is Page Load Strategy?

When Thunder Code runs tests on your website, it needs to know when a page has finished loading before it can start testing. Different websites load content in different ways, so you can customize this behavior to match your site's needs.

By default, Thunder Code uses a 3-step approach:

  1. Network Idle - Waits for network requests to quiet down

  2. DOMContentLoaded - Waits for the HTML structure to be ready

  3. Load Event - Waits for all images, scripts, and resources to finish loading

Why Customize Page Load Strategy?

You might want to customize this if your website:

  • Has animations that play after the page loads

  • Uses lazy loading for images or content

  • Has dynamic content that appears with a delay

  • Loads very quickly and doesn't need long timeouts

  • Takes longer than usual to load certain resources

Configure Page Load Strategy

Access Page Load Settings

You can configure page load settings in two ways:

Via Project Settings

Navigate to your Test Project → Project SettingsPage Load Settings tab

During Project Onboarding

Configure these settings during the Project Creation flow

Configure the Four Loading Parameters

The Page Load Settings form contains four configurable fields:

NetworkIdle timeout (ms)

  • Default: 5000 (5 seconds)

  • Range: 0 - 60000ms

  • What it does: Waits for network requests to quiet down

  • Example: Enter 3000 for faster-loading sites or 8000 for content-heavy pages

LoadEvent timeout (ms)

  • Default: 45000 (45 seconds)

  • Range: 0 - 60000ms

  • What it does: Waits for all resources like images and scripts to finish loading

  • Example: Enter 30000 for sites with fewer resources or 60000 for media-heavy sites

DOMContentLoaded timeout (ms)

  • Default: 10000 (10 seconds)

  • Range: 0 - 60000ms

  • What it does: Waits for HTML parsing to complete and DOM to be ready

  • Example: Enter 8000 for simple pages or 15000 for complex DOM structures

Await Time (ms)

  • Default: 0 (no additional wait)

  • Range: 0 - 60000ms

  • What it does: Additional wait time after the page is considered loaded

  • Example: Enter 2000 to wait 2 extra seconds for animations or 5000 for slow-rendering dynamic content

Save Your Configuration

Click "Save" to apply your custom page load strategy to all future test runs for this project.

Reset to Default Settings

To return to the default page load strategy:

  1. Clear all the input fields (delete the values you've entered)

  2. Click "Save"

  3. The system will automatically use the default values:

    • NetworkIdle timeout: 5000ms

    • LoadEvent timeout: 45000ms

    • DOMContentLoaded timeout: 10000ms

    • Await Time: 0ms

Troubleshooting

Tests are timing out: Try increasing the timeout values.

Tests start too early: Add a post-load delay or include additional loading events.

Pages load slower in tests than expected: Your site might need longer timeouts or a different combination of loading events.

Did this answer your question?