Praman — Agent-First SAP UI5 Test Automation Plugin - v1.2.0
    Preparing search index...

    Function setDatePickerValue

    • Ai

      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).

      • Optionaloptions: DateOptions

        Optional date operation settings.

      Returns Promise<void>

      ui5.date.setDatePicker

      Set a date on a UI5 DatePicker control with automatic format conversion.

      On success, the control's value is set and fireChange() has been called.

      The control must be a sap.m.DatePicker and must exist in the UI5 view.

      Date picker interaction:

      1. await setDatePickerValue(page, controlId, date)
      2. Optionally validate: await setAndValidateDate(page, controlId, date)
      3. Read back: const val = await getDatePickerValue(page, controlId)

      Reads the control's valueFormat, converts the input to match, then calls setValue() + fireChange(). This prevents the silent wrong-format bug where the date shows as invalid in the UI.

      sap.m.DatePicker — setValue(), getValueFormat(), fireChange()

      Set dates on SAP form fields (posting date, delivery date, etc.).

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

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