Skip to content
CodeKruPro

Handle Prompt Dialog

44/70

Handle Prompt Dialog

A prompt dialog accepts text input. Use dialog.accept(text) to enter text and click OK.

On the Alerts page, clicking "Show Prompt" triggers a prompt. The page shows You entered: followed by your text in #promptResult.

Task:

  1. Navigate to https://testkru.com/Interactions/Alerts
  2. Set up handler to type "Playwright" and accept
  3. Click "Show Prompt"
  4. Print the result text from #promptResult

Expected output:

Prompt response: You entered: Playwright