sdk.automation.getvalue
Home > @matterway/sdk > Automation > getValue
Automation.getValue() function
Returns the value of a form element.
Signature:
export declare function getValue(ctx: Context, selector: string, options?: WaitForSelectorOptions): Promise<string | null>;
Parameters
Parameter | Type | Description |
---|---|---|
ctx | Context | Context object. |
selector | string | The element selector for which to return value. The value of the form element as a string. |
options | WaitForSelectorOptions | (Optional) |
Returns:
Promise<string | null>
Example
const firstName = await getValue(ctx, 'input[name="firstName"]');