Skip to main content
Version: 1.x

Interface: UI5Selector

Defined in: src/core/types/selectors.ts:66

UI5 control selector — the primary type for control discovery.

Remarks

All selector fields are optional; at least one must be provided for a valid query. The ancestor and descendant fields are recursive for hierarchical matching.

When searchOpenDialogs is true, the selector engine also searches controls rendered inside the UI5 static area (sap.ui.core.UIArea for open dialogs, popovers, and message boxes). This is essential for interacting with dialog controls, which exist outside the main view DOM hierarchy.

Examples

import type { UI5Selector } from '#core/types/selectors.js';

const selector: UI5Selector = {
controlType: 'sap.m.Button',
properties: { text: 'Save' },
};
import type { UI5Selector } from '#core/types/selectors.js';

// Find a button inside an open confirmation dialog
const dialogButton: UI5Selector = {
controlType: 'sap.m.Button',
properties: { text: 'OK' },
searchOpenDialogs: true,
};

// Find an input field inside a value help dialog
const valueHelpInput: UI5Selector = {
controlType: 'sap.m.Input',
searchOpenDialogs: true,
ancestor: {
controlType: 'sap.ui.comp.valuehelpdialog.ValueHelpDialog',
},
};

Properties

ancestor?

readonly optional ancestor: UI5Selector

Defined in: src/core/types/selectors.ts:82

Recursive ancestor selector — control must be inside a matching ancestor.


bindingPath?

readonly optional bindingPath: Readonly<Record<string, string>>

Defined in: src/core/types/selectors.ts:78

OData binding path matchers for data-bound controls.


controlType?

readonly optional controlType: string & object | keyof UI5ControlMap

Defined in: src/core/types/selectors.ts:68

UI5 fully qualified control type, e.g., 'sap.m.Button'.


descendant?

readonly optional descendant: UI5Selector

Defined in: src/core/types/selectors.ts:84

Recursive descendant selector — control must contain a matching descendant.


i18NText?

readonly optional i18NText: Readonly<Record<string, string>>

Defined in: src/core/types/selectors.ts:80

i18n text matchers (property name to expected translated value).


id?

readonly optional id: string | RegExp

Defined in: src/core/types/selectors.ts:70

Control ID or RegExp pattern for ID matching.


interaction?

readonly optional interaction: UI5Interaction

Defined in: src/core/types/selectors.ts:86

Sub-control interaction target (idSuffix, domChildWith).


properties?

readonly optional properties: Readonly<Record<string, unknown>>

Defined in: src/core/types/selectors.ts:76

Key-value property matchers evaluated against control.getProperty().


searchOpenDialogs?

readonly optional searchOpenDialogs: boolean

Defined in: src/core/types/selectors.ts:88

When true, also searches controls inside open dialogs/popovers.


viewId?

readonly optional viewId: string

Defined in: src/core/types/selectors.ts:74

Owning view ID for scoped discovery.


viewName?

readonly optional viewName: string

Defined in: src/core/types/selectors.ts:72

Owning view name for scoped discovery.