sdk.automation.setcheckbox
Home > @matterway/sdk > Automation > setCheckbox
Automation.setCheckbox() function
Checks the checkbox element, unless a specific value is passed.
Signature:
export declare function setCheckbox(ctx: Context, selector: string, value?: boolean): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
ctx | Context | |
selector | string | Selector for checkbox to toggle. |
value | boolean | (Optional) |
Returns:
Promise<void>
Example 1
await setCheckbox(page, 'input[id="first-checkbox"]');
Example 2
await setCheckbox(page, 'input[id="third-checkbox"]', false);