Interface: UI5Selector
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?
readonlyoptionalancestor?:UI5Selector
Recursive ancestor selector — control must be inside a matching ancestor.
bindingPath?
readonlyoptionalbindingPath?:Readonly<Record<string,string>>
OData binding path matchers for data-bound controls.
controlType?
readonlyoptionalcontrolType?:string&object| keyof UI5ControlMap
UI5 fully qualified control type, e.g., 'sap.m.Button'.
descendant?
readonlyoptionaldescendant?:UI5Selector
Recursive descendant selector — control must contain a matching descendant.
i18NText?
readonlyoptionali18NText?:Readonly<Record<string,string>>
i18n text matchers (property name to expected translated value).
id?
readonlyoptionalid?:string|RegExp
Control ID or RegExp pattern for ID matching.
interaction?
readonlyoptionalinteraction?:UI5Interaction
Sub-control interaction target (idSuffix, domChildWith).
matchSubclasses?
readonlyoptionalmatchSubclasses?:boolean
When true, matches controls that are subclasses of the specified controlType.
Example
// Matches sap.m.Button AND sap.m.ToggleButton (which extends Button)
const selector: UI5Selector = {
controlType: 'sap.m.Button',
matchSubclasses: true,
};
properties?
readonlyoptionalproperties?:Readonly<Record<string,string|number|boolean|RegExp|PropertyMatcher>>
Key-value property matchers evaluated against control.getProperty().
searchOpenDialogs?
readonlyoptionalsearchOpenDialogs?:boolean
When true, also searches controls inside open dialogs/popovers.
viewId?
readonlyoptionalviewId?:string
Owning view ID for scoped discovery.
viewName?
readonlyoptionalviewName?:string
Owning view name for scoped discovery.