Skip to main content
Version: 1.x

Function: confirmDialog()

confirmDialog(page, options?): Promise<void>

Defined in: src/modules/dialog.ts:355

Ai

Confirms a dialog by pressing its begin button or a button matching common confirm labels.

Parameters

page

DialogPage

Playwright Page (or compatible subset).

options?

FindDialogOptions & object

Options to filter which dialog and optionally specify a custom button text.

Returns

Promise<void>

Intent

Confirm (accept) the topmost dialog by pressing its primary action button.

Guarantee

On success, the dialog's begin button or a confirm-label button has been pressed.

Recipe

Multi-step dialog confirmation:

  1. Execute the action that triggers the dialog
  2. await waitForDialog(page, { title: 'Confirm' })
  3. await confirmDialog(page)
  4. await waitForDialogClosed(page, dialogId)

Ai Context

Tries beginButton first, then scans buttons for labels: OK, Yes, Confirm, Save, Accept, Submit. Pass buttonText option to target a specific non-standard button.

Sap Module

sap.m.Dialog — beginButton / buttons aggregation / firePress()

Business Context

Confirm SAP dialogs (save confirmation, delete confirmation, approval dialogs).

Throws

ControlError if no open dialog or confirm button is found.

Example

await confirmDialog(page);