Skip to main content
Version: 1.x

Interface: UI5ControlBase

Base interface all UI5 controls extend.

Remarks​

Maps to sap.ui.core.Element / sap.ui.core.Control base methods. All methods return Promise<T> because they execute via the bridge adapter in the browser context.

Example​

import type { UI5ControlBase } from '#core/types/controls.js';

async function logControl(control: UI5ControlBase): Promise<void> {
const id = await control.getId();
const type = await control.getControlType();
console.log(`${type}#${id}`);
}

Properties​

controlType​

readonly controlType: string

Fully qualified control type, e.g., 'sap.m.Button'.


id​

readonly id: string

Control ID assigned in the UI5 view or generated.

Methods​

getAggregation()​

getAggregation(name): Promise<readonly UI5ControlBase[]>

Returns controls in a named aggregation.

Parameters​

name​

string

Returns​

Promise<readonly UI5ControlBase[]>


getBindingInfo()​

getBindingInfo(name): Promise<unknown>

Returns binding info for a named property.

Parameters​

name​

string

Returns​

Promise<unknown>


getControlType()​

getControlType(): Promise<string>

Returns the fully qualified control type name.

Returns​

Promise<string>

Remarks​

Praman proxy convenience — equivalent to getMetadata().getName() in native UI5.


getDomRef()​

getDomRef(): Promise<Element | null>

Returns the DOM reference element, or null if not rendered.

Returns​

Promise<Element | null>


getId()​

getId(): Promise<string>

Returns the control's ID.

Returns​

Promise<string>


getModel()​

getModel(name?): Promise<unknown>

Returns the named model, or the default model if no name given.

Parameters​

name?​

string

Returns​

Promise<unknown>


getProperty()​

getProperty(name): Promise<unknown>

Gets a named property value.

Parameters​

name​

string

Returns​

Promise<unknown>


getVisible()​

getVisible(): Promise<boolean>

Returns whether the control is visible (getVisible() on sap.ui.core.Control).

Returns​

Promise<boolean>


isBound()​

isBound(propertyName): Promise<boolean>

Returns whether a property is data-bound.

Parameters​

propertyName​

string

Returns​

Promise<boolean>


setProperty()​

setProperty(name, value): Promise<void>

Sets a named property value.

Parameters​

name​

string

value​

unknown

Returns​

Promise<void>


toLocator()​

toLocator(): Promise<Locator>

Converts this control proxy to a Playwright Locator via its DOM reference.

Returns​

Promise<Locator>

Playwright Locator pointing to the control's DOM element

Example​

const button = await ui5.control({ controlType: 'sap.m.Button', properties: { text: 'Save' } });
const locator = await button.toLocator();
await expect(locator).toBeVisible();