MicrosoftEdge / EdgeWebDriver

Feedback and discussions about WebDriver for Microsoft Edge
MIT License
58 stars 7 forks source link

Alert is not displayed while leaving site during test execution on EdgeDriver 127 version #155

Open jogernaut opened 4 months ago

jogernaut commented 4 months ago

The "Leave site?" alert is not displayed in the Edge Beta when using EdgeDriver 127 version. The bug is reproduced only if the Edge Beta was opened by EdgeDriver. If the steps that trigger the alert are performed in a manually opened Edge Beta browser, the alert appears as expected.

Steps to reproduce:

  1. Prepare html which will generate alert if form is dirty and user wants to leave the site (example of html in attachments leave_site_test.zip)
  2. Write C# Selenium based code, where user navigate to the page 'leave_site_test.html'
  3. Fill in the Name field
  4. Try to close the page

Actual result: Alert is not presented (see https://github.com/user-attachments/assets/bb5ce985-5095-442f-84b8-e3a8a14281b3 ) Expected result: Alert is displayed after leaving the site (see https://github.com/user-attachments/assets/620092c7-d315-4163-bc74-6d3e3400f0df )

Edge Beta version: 127.0.2651.49 (Official build) beta (64-bit) Selenium.WebDriver.MSEdgeDriver: 127.0.2651.31-pre

Starting from EdgeDriver 127 alert are not displayed when leaving site with unsaved data during Selenium Test execution. Also bug is reproduced on stable versions of EdgeDrivers (127.0.2651.2 and 127.0.2651.45)

If run test on Edge Beta 127 but with old version of EdgeDriver (126.0.2592.102) there is no issue - alert appears. If run Selenium tests on Edge 126 and EdgeDriver (126.0.2592.102) - no issues as well.

MrAtkinson commented 3 months ago

Related https://issues.chromium.org/issues/42323840