Skip to main content

sdk.automation.getproperty

Home > @matterway/sdk > Automation > getProperty

Automation.getProperty() function

Returns the value of an element property.

Signature:

export declare function getProperty(ctx: Context, selector: string, propertyName: string, options?: WaitForSelectorOptions): Promise<string | null>;

Parameters

ParameterTypeDescription
ctxContextContext object.
selectorstringElement selector.
propertyNamestringThe name of the property to retrieve.
optionsWaitForSelectorOptions(Optional)

Returns:

Promise<string | null>

The property value as a string.

Example

const clientName = await getProperty(ctx, 'input[name="firstName"]', 'value');