# Dynamic Content

Stop dynamic and animated page fragments from generating visual diffs on every run by ignoring them with XPath or CSS selectors.

Timestamps, ads, carousels, avatars, live counters, animated banners - anything that renders differently on every visit will produce a diff on every session, drowning out the changes you actually care about.

The fix is to **exclude those elements from the comparison**. The ignored region is not compared, so the rest of the page still gets full coverage.

## Ignoring elements in the suite

In the [suite settings](/docs/tests/visual-tests/suite-settings.md), add entries to the **Ignore** list using XPath or CSS selectors pointing at the dynamic elements:

```
//div[@id='live-chat']
//*[@data-testid='ad-slot']
.cookie-banner
```

Suite-level entries apply to every snapshot. To ignore an element on a single view only, add the override on that snapshot instead of the suite.

## Ignoring elements in scriptless captures

The [`bdy tests capture`](/docs/cli/tests/capture.md) command takes the same selectors with `--ignore` (prefixed with `CSS=` or `XPATH=`), optionally scoped to a domain:

```bash
bdy tests capture --sitemap https://example.com/sitemap.xml \
  --ignore "CSS=.ad-banner" "XPATH=//div[@id='popup']" "example.com::CSS=.cookie-notice"
```

## Animations

For animated fragments (auto-playing videos, CSS animations, spinners), you have two options:

- ignore the animated element like any other dynamic content, or
- if the animation settles after load, add a **Delay** or **Wait for selector** so the capture happens after it finishes - see [Lazy loading](/docs/tests/visual-tests/troubleshooting/lazy-loading.md)

As a last resort, **Post page capture JS** in the suite settings can disable animations or hide elements programmatically before the comparison.


---
Original source: https://buddy.works/docs/tests/visual-tests/troubleshooting/dynamic-content