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
Parameter | Type | Description |
---|---|---|
ctx | Context | Context object. |
selector | string | Element selector. |
propertyName | string | The name of the property to retrieve. |
options | WaitForSelectorOptions | (Optional) |
Returns:
Promise<string | null>
The property value as a string.
Example
const clientName = await getProperty(ctx, 'input[name="firstName"]', 'value');