Skip to main content

Function: setDatePickerValue()

setDatePickerValue(page, controlId, date, options?): Promise<void>

Defined in: src/modules/date.ts:232

Sets a date value on a sap.m.DatePicker control.

Parameters​

page​

DatePage

Playwright Page (or compatible subset).

controlId​

string

The ID of the DatePicker control.

date​

DateInput

The date to set (Date object or ISO string).

options?​

DateOptions

Optional date operation settings.

Returns​

Promise<void>

Remarks​

Reads the control's valueFormat, converts the input accordingly, then calls setValue() and fireChange({valid: true}) in a single evaluate script.

Example​

await setDatePickerValue(page, 'datePicker1', new Date(2024, 0, 15));
await setDatePickerValue(page, 'datePicker1', '2024-01-15');