Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 6 additions & 8 deletions docs/smartui-hooks-region-ignore.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ This gives the Web Hooks path the same region controls already available on RD H

Pass a `coordinates` entry (a list of `"x1,y1,x2,y2"` strings) under `ignoreDOM`. SmartUI excludes those rectangles from the comparison. The four values are the left, top, right, and bottom edges of the rectangle in pixels.

<img loading="lazy" src={require('../assets/images/smartui-hooks-region-ignore/coordinate-rectangle.png').default} alt="A coordinate rectangle: x1,y1 is the top-left corner (left=50, top=50) and x2,y2 is the bottom-right corner (right=300, bottom=300), giving a 250 x 250 region." width="503" height="490" className="doc_img img_center"/>

For example, `"50,50,300,300"` defines the region whose top-left corner is at `(left=50, top=50)` and whose bottom-right corner is at `(right=300, bottom=300)` — a 250 × 250 rectangle.

<Tabs className="docs__val" groupId="language">
<TabItem value="java" label="Java" default>

Expand Down Expand Up @@ -190,6 +194,7 @@ config.ignoreDOM = {
cssSelector: ['.promo'], // selector
coordinates: ['847,185,1571,734'], // coordinates
};
await driver.executeScript('smartui.takeScreenshot', config);
// both regions are ignored
```

Expand All @@ -201,19 +206,13 @@ config["ignoreDOM"] = {
"cssSelector": [".promo"], # selector
"coordinates": ["847,185,1571,734"], # coordinates
}
driver.execute_script("smartui.takeScreenshot", config)
# both regions are ignored
```

</TabItem>
</Tabs>

## Behaviour summary

| Input mode | How you pass it (under `ignoreDOM` / `selectDOM`) | Resolved against | Result |
|------------|---------------------------------------------------|------------------|--------|
| Selector | `id` / `class` / `xpath` / `cssSelector` | Live DOM (`getBoundingClientRect()`) | Region of the matched element(s). |
| Coordinate | `coordinates: ["x1,y1,x2,y2"]` | The produced-image space (viewport or full page) | Exactly the supplied rectangle. |

## Validation and errors

Coordinates are validated at two levels — note that only the **format** check happens on the hooks ingestion path; **page-bounds** elimination is a downstream comparison-engine behaviour, not part of the hooks request validation:
Expand All @@ -225,7 +224,6 @@ Coordinates are validated at two levels — note that only the **format** check

## Notes

- **Scope:** this applies to the Web Hooks path (Selenium `executeScript("smartui.takeScreenshot", ...)`). RD Hooks and the CLI SDK already support these inputs.
- **Empty or mixed configs:** a config containing only `coordinates` (no selector) is honoured — it is not treated as "no DOM region." Selector and coordinate regions in one `ignoreDOM` are additive.
- **Identical to selector-based ignore:** coordinate regions resolve to the same kind of ignored/selected box as selectors, so the comparison result matches an equivalent selector-based ignore.

Expand Down