For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content

Layout Regions New

A Layout Region is an annotation you draw on a capture to compare that one area for structure only. Inside the region SmartUI checks whether elements were added, removed, or moved. Changes to the content inside those elements, such as text, values, and colors, do not raise a difference. Everything outside the region continues to use the build's normal comparison mode.

This gives you a middle ground that the existing options do not cover:

  • Layout Comparison applies structure-only matching to the whole capture, so genuine content and color regressions elsewhere on the page stop being reported.
  • An Ignore Region removes the area from validation entirely, so a section that disappears or collapses is never flagged.
  • A Layout Region keeps the section under validation, checks that its structure is intact, and tolerates the content churn inside it.

When to Use

  • Regulated or generated documents where timestamps, run IDs, and batch values change on every run but the document structure must stay fixed
  • Dashboards, feeds, and listings whose rows and cards carry live data while the arrangement is expected to hold
  • Localized pages where translated strings vary in length and the surrounding structure has to survive
  • Any section you are currently ignoring purely because the content is noisy, when you still want to know if the section breaks or disappears

Comparing the Region Types

Region typeStructure checkedContent checkedColors checkedTypical use
Ignore RegionNoNoNoFully dynamic areas you do not need validated
Select RegionYesYesYesRestrict the comparison to a critical component
Ignore ColorsYesYesNoThemed or A/B tested areas
Floating RegionYesYesYesElements that shift position inside a boundary
Layout RegionYesNoNoDynamic content in a section whose structure must hold

How to Use

Prerequisites

info

For web comparisons, a Layout Region works only when the DOM was recorded at capture time. SmartUI compares the recorded structure of the two captures, so a build that carries a screenshot image alone has nothing to analyze. See DOM Recording Requirement for which capture flows record it.

PDF comparisons are not affected. They read the structure out of the document itself, so no DOM is involved.

Step 1: Open a screenshot comparison in your SmartUI project and click the Actions button (annotation icon) to open the annotation tool.

Step 2: Click Add Region and draw a box around the section whose structure you want to validate.

Step 3: Select Layout Region from the annotation type dropdown.

Step 4: Click Save, then choose whether the region applies to the current screenshot only or to all browser variants.

What Happens: The comparison re-runs. Inside the region SmartUI reports only structural changes. Outside the region the comparison is unchanged. Layout Regions persist to later builds for the same screenshot exactly like Ignore Regions do, and they appear in the annotation overlay in green.

note

You can draw more than one Layout Region on a capture, and you can mix Layout Regions with Ignore, Select, Floating, and Ignore Colors regions on the same screenshot. For PDF comparisons, regions are drawn per page.

How It Works

SmartUI does not read pixels inside a Layout Region. It compares a structural description of the region taken from the baseline against the same description taken from the comparison capture, then highlights only the elements that do not line up.

For web captures, SmartUI uses the DOM element data recorded alongside each screenshot. This requires the capture flow to have recorded the DOM, as described in DOM Recording Requirement.

  1. Elements whose center point falls inside the region are collected from the baseline capture and from the comparison capture.
  2. Each pair is scored on DOM path, classes, applied styles, element id, size, and tag name. Pairs above the match threshold are treated as the same element and are not reported.
  3. Elements left without a match on the other side are highlighted as structural differences. An element present in the baseline but missing in the comparison is highlighted on the baseline, and the reverse case is highlighted on the comparison.
  4. Elements that drifted slightly outside the box are still considered for matching, so a small shift across the edge does not produce a false difference. Highlights themselves stay inside the region you drew.
  5. Page level wrapper containers that merely overlap the region are excluded, so the region reports the elements you framed rather than the layout of the whole page.

Because the match is structural, a text or value change inside an element that is otherwise unchanged does not raise a difference. That is the intended behavior of the region.

DOM Recording Requirement for Web Comparisons

The structural analysis behind a web Layout Region reads the DOM that was recorded alongside each screenshot. That recording happens at capture time, not at comparison time, so it cannot be added to a build after the fact. If a build was captured without it, drawing a Layout Region on that build gives you plain ignore behavior instead of structural analysis.

Capture flowDOM recordedLayout Region behavior
SmartUI CLI and SDK web capturesYes, on every snapshotFull structural analysis
SmartUI in test automation, using Lambda Hooks or full page automation capturesOnly when DOM recording is enabled for your organizationStructural analysis once enabled, plain ignore until then
Screenshot API uploads and static image uploadsNoPlain ignore
Real device web and app capturesNoOption not offered
PDF comparisonsNot applicableFull structural analysis from the document

DOM recording is on by default for SmartUI CLI and SDK web captures, because those flows capture the page structure and render it on the TestMu AI cloud. It is not on by default for captures taken inside an automation session. If you are running SmartUI through Lambda Hooks or through your automation suite and want Layout Regions to analyze structure, contact support to have DOM recording enabled for your organization.

warning

When the DOM was not recorded, the region does not fail or error. It quietly behaves like an Ignore Region, which means the area stops being validated at all. If you drew a Layout Region and it never reports anything, check the capture flow first.

Where the Option Is Available

The Layout Region option appears in the region dropdown for web captures and PDF comparisons. It is not offered for:

  • Real device web and app tests
  • Espresso and XCUI tests
  • App SDK tests
  • Storybook projects
  • Figma projects
  • Single image uploads through the API

For these test types the dropdown shows the Ignore, Select, Floating, and Ignore Colors options only.

Behavior Notes and Limitations

  • Content changes are not reported inside the region. If you need value changes flagged, a Layout Region is the wrong tool for that area. Use the normal comparison, or scope it with a Select Region.
  • Select and Ignore regions win. If a Layout Region overlaps an Ignore Region, the ignored area stays ignored. If Select Regions are in use, anything outside them is still excluded.
  • The DOM has to have been recorded for both captures. A web Layout Region cannot analyze a build that carries only a screenshot image. See DOM Recording Requirement. If the recorded data is missing or cannot be read, the region falls back to behaving like a plain Ignore Region and the comparison still completes. Nothing fails.
  • Very dense regions fall back too. A region drawn over an extremely large number of elements is skipped rather than analyzed, and behaves like an Ignore Region for that build. Draw the region around the section you care about rather than the whole page.
  • Highlights count towards the mismatch percentage. Structural differences found inside a Layout Region are treated as differences in the build result, the same as any other highlighted change.
  • Region scope works as it does everywhere else. A Layout Region belongs to the screenshot variant you drew it on until you choose Apply to all variants.

Troubleshooting

Issue: The annotation type dropdown does not list Layout Region.

Solutions:

  • Confirm the test type supports it. See Where the Option Is Available.
  • Make sure you are on a screenshot comparison view and not on a build listing.
  • Refresh the page so the annotation tool reloads with the current screenshot's test type.

Additional Resources

Test across 3000+ combinations of browsers, real devices & OS.

×
Schedule Your Personal Demo
Book Demo

Help and Support

Related Articles