# Identifying Oracle Redwood elements

> Selector attributes surfaced by UI Automation for Oracle Redwood elements, including redwood-id, data-key, and data-oj-field.

Oracle Redwood pages render UI through Oracle JET (Oracle JavaScript Extension Toolkit) custom elements. Selectors generated for these elements are easy to recognize by the `oj-` prefix on the `tag` attribute and by the framework-specific attributes described below.

A selector for an Oracle Redwood element contains the `<webctrl>` tag, similar to other web UI elements.

The following attributes are surfaced in selectors for Oracle Redwood elements:

| Attribute | Description |
| --- | --- |
| `tag` | The JET custom element tag (for example, `oj-button`, `oj-input-text`, `oj-table`, `oj-list-view`). Helps to disambiguate JET components from plain HTML elements. |
| `redwood-id` | Stable identifier derived from JET's `:id` binding expression. JET often regenerates random `id` values on refresh while the `:id` expression does not, so prefer `redwood-id` when available. |
| `data-key` | Key that JET stamps on data-bound or dynamic containers, such as dashboard cards or grouped-table headers, set to the bound item's key. Not present on ordinary rows; the selector anchors the nearest ancestor that carries `data-key`. |
| `data-oj-field` | Name of the bound field, stamped by JET on a parent element of form fields. Surfaced on the enclosing ancestor, keeping the selector stable when the field's internals re-render. |

The `id` attribute of Oracle Redwood elements is included in selectors only when its value is reliable. JET auto-generates many `id` values that change between page loads or sessions; the driver recognizes these and leaves them out of the selector. When the `id` is filtered, the driver falls back to `redwood-id` and the surrounding JET component's stable identifier. The `redwood-id` value also provides the element's display name in Studio when the element has no better name.

The driver can also add a `class` attribute holding the JET role class of the indicated element (for example, `class='*oj-button-text*'` for the text part inside an `oj-button`). JET composites paint these role classes onto their inner parts, which makes them a stable way to address a part when the part itself has no id.

## Examples

**redwood-id vs id.** JET regenerates an element's `id` on every render, for example a message banner whose `id` cycles through `_oj45_bannerunsaved`, `_oj112_bannerunsaved`, … as the `_ojNNN` counter advances. The driver filters that volatile `id` and uses the stable `redwood-id` (derived from the component's `:id` binding) instead:

```xml
<webctrl tag='OJ-MESSAGE-BANNER' redwood-id='uidbannerunsaved' />
```

**data-key + role class (a dashboard metric).** Each dashboard card is a data-bound container JET stamps with `data-key`, so the selector anchors the card by its key; the value element inside it is pinned by its JET role class:

```xml
<webctrl tag='DIV' data-key='accounts' />
<webctrl tag='DIV' class='*oj-sp-scoreboard-metric-card-metric*' />
```

![Oracle Redwood dashboard with the data-key card and the role-class metric value highlighted](https://dev-assets.cms.uipath.com/assets/images/activities/oracle-fusion/redwood-data-key-and-role-class-956c8afd.png)

**data-oj-field (a form field).** In an edit/create form, JET stamps the bound field name on the field component, which the driver uses to anchor the field regardless of its internal `id` churn:

```xml
<webctrl tag='OJ-COMBOBOX-ONE' data-oj-field='OrganizationName' />
```

**A CX picker field.** The picker's `oj-vb-fragment` gets a runtime id of the form `{fieldName}-cx-{uid}`, where the suffix is regenerated every session. The driver recovers the stable field name and anchors the fragment with a wildcard id:

```xml
<webctrl tag='OJ-VB-FRAGMENT' id='PrimaryContactPartyId-cx-*' />
<webctrl tag='INPUT' type='text' />
```

![Oracle Redwood Create Account form with the data-oj-field and cx-picker fields highlighted](https://dev-assets.cms.uipath.com/assets/images/activities/oracle-fusion/redwood-data-oj-field-and-cx-picker-82a5afb6.png)

:::tip
The project's **Selector - Default find type** should be **One match** so ambiguous selectors fail at authoring time rather than at runtime — see [About Oracle Redwood automation](https://docs.uipath.com/activities/other/latest/ui-automation/about-oracle-redwood-automation).
:::
