microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.16k stars 3.61k forks source link

[BUG] Unable to capture Alert in Screenshots and Video Recording #26685

Closed vipinphogat91 closed 1 year ago

vipinphogat91 commented 1 year ago

System info

In my test case I am clicking on a button which triggers a JavaScript alert. Though I am able to see and interact with the alert during execution but the same is not getting captured in:

  1. Screenshot - IN the screenshot only the page responsible for triggering the alert is displayed
  2. Video - In video, only the actions (like click on button) responsible for triggering the alert is displayed
  3. Trace - Steps for handling the alert is captured but no screenshots are displayed

Source code

Application URL - https://www.lambdatest.com/selenium-playground/javascript-alert-box-demo

Button XPath - (//button[text()="Click Me"])[1]

Steps for handling alert:

` page.on('dialog', async (alert) => { let alertMsg = alert.message()

await alert.accept() })

await element.click()`

yury-s commented 1 year ago

Alert and dialogs in general are not a part of the web content of the page and as such are not captured on the video/screenshots. This is the same as https://github.com/microsoft/playwright/issues/17639

Closing as there are no plans to support it.