Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk3 min

How to Ignore Dynamic Content in BackstopJS Screenshots

Learn when to use BackstopJS hideSelectors, removeSelectors, readiness options, and deterministic fixtures to handle dynamic content in screenshot tests.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use hideSelectors when changing content should disappear from the screenshot but its space should remain in the layout. Use removeSelectors when the element and its footprint should be removed. For the most reliable visual regression tests, make dynamic application data deterministic instead of relying on live content.

Choose whether the layout space should remain

BackstopJS offers two selector options for excluding unstable page content. Set them on a scenario when the rule applies to that scenario, or in shared configuration when it applies more broadly.

As an Amazon Associate I earn from qualifying purchases.

Option What happens Use it when
hideSelectors Matched elements are set to visibility:hidden; they remain in layout flow. The content changes, but the region’s dimensions and position should remain part of the comparison.
removeSelectors Matched elements are removed before the screenshot. The element and its footprint should not be in the capture, particularly when its size varies.

Removing an element can move content below it because the element no longer occupies space. That may be appropriate if the region is outside the behavior you want to test, but it can also hide or create layout changes that matter. These semantics are documented in the BackstopJS project documentation; check the documentation for your installed version if exact behavior is important.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure selectors in a scenario

Hide changing pixels while preserving geometry

For an ad slot, timestamp, or rotating text whose space should remain under test, add a hideSelectors array:

{
  "scenarios": [
    {
      "label": "page with a dynamic ad",
      "url": "https://example.test/page",
      "hideSelectors": ["#dynamic-ad"]
    }
  ]
}

Replace the example URL and selector with values from your application. Since hiding preserves layout flow, the element’s space remains, but the matched content is hidden from visual comparison.

Remove a variable-size region

If a feed or other region should be absent from the screenshot entirely, use removeSelectors:

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option
{
  "scenarios": [
    {
      "label": "page without unpredictable feed",
      "url": "https://example.test/page",
      "removeSelectors": ["#dynamic-feed"]
    }
  ]
}

Use removal deliberately: downstream elements may shift when the region’s layout footprint disappears. If that reflow is relevant to the test, hide the region or control its content instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prefer deterministic data when content affects layout

For dynamic applications, BackstopJS documentation recommends known static data stubs rather than testing live dynamic content. A fixture makes the input repeatable while still letting you verify how the page handles content of different lengths. If text length, item count, or other content-driven geometry is important, test representative fixture variants rather than hiding the whole region.

Do not use waits as a substitute for stable content

readySelector waits for a selector to appear, and readyEvent waits for the application to log a specified console message. delay waits for a fixed duration and, when combined with readyEvent, applies after that event. These options help capture the intended state; they do not prevent content from changing after the wait.

For custom setup after readiness conditions are met, use onReadyScript. The project documentation describes this option for modifying UI state, including simulating user actions or states before capture. It can be useful when the page needs setup, but it does not make uncontrolled live data reproducible by itself.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Check what the scenario still tests

  1. Run the scenario and inspect the resulting screenshot and diff.
  2. Confirm that each selector matches the intended element on the page.
  3. Check whether hiding leaves a changing border, shadow, or surrounding component visible; adjust the target region if necessary.
  4. After removal, inspect downstream positioning and decide whether the resulting reflow is acceptable.
  5. Keep important layout behavior in scope; use deterministic fixtures instead of suppressing a region when its content-driven geometry matters.

BackstopJS also documents misMatchThreshold for the percentage difference tolerated before a screenshot fails and requireSameDimensions for whether dimensions must match. The repository documentation page accessed on 2026-10-03 reports defaults of 0.1 and true, respectively. The page is not pinned to a release tag, so verify defaults against the documentation bundled with your installed version. These comparison settings do not stabilize changing content or replace a suitable selector or fixture.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a screenshot without configuring a browser-based visual regression scenario, ScreenshotNeo provides a one-request screenshot API. This captures a page; it does not replace BackstopJS’s baseline-and-diff workflow.

See the ScreenshotNeo documentation for API options. Example cURL request:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.test/page -o shot.webp

ScreenshotNeo can accept cookie and consent banners and remove known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify page verdict and billing status in headers. Its MCP server offers screenshot tools for AI agents and other MCP clients. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.