Skip to content

[🐛 Bug]: Firefox JS Alert is closed automatically? #14290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adeherdt-r7 opened this issue Jul 22, 2024 · 7 comments
Closed

[🐛 Bug]: Firefox JS Alert is closed automatically? #14290

adeherdt-r7 opened this issue Jul 22, 2024 · 7 comments
Labels
I-defect Something is not working as intended J-issue-template Applied to issues not following the template, or missing information.

Comments

@adeherdt-r7
Copy link

What happened?

Hello,

I'm working on a test suite in Ruby on Rails using Selenium, Capybara and Firefox as test browser.
At some point during the tests, the browser is supposed to click on a button, see the alert and accept it.
The problem is, this is not happening in firefox.

When I click the button manually, the alert actually shows, but when the test-framework tries it, nothing happens.
However, when I set a breakpoint on the step, where the button is clicked, I can see the alert appearing.
But as soon as the framework proceeds to the next step, the alert disappears and the step responsible for clicking it fails.

How can we reproduce the issue?

* Write a simple page that triggers an alert on button click
* Have a step to trigger the alert
* Have a step to dismiss/accept the alert
* Run with firefox

Relevant log output

-

Operating System

macOS Sonoma 14.5

Selenium version

selenium-webdriver (4.22.0)

What are the browser(s) and version(s) where you see this issue?

Firefox 128.0

What are the browser driver(s) and version(s) where you see this issue?

Are you using Selenium Grid?

No response

@adeherdt-r7 adeherdt-r7 added I-defect Something is not working as intended A-needs-triaging A Selenium member will evaluate this soon! labels Jul 22, 2024
Copy link

@adeherdt-r7, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@adeherdt-r7
Copy link
Author

Additional information : serenity-bdd/serenity-core#2470
The linked issue is exactly the same behavior I am running into.

@diemol diemol added J-issue-template Applied to issues not following the template, or missing information. and removed A-needs-triaging A Selenium member will evaluate this soon! labels Jul 22, 2024
Copy link

Hi, @adeherdt-r7.
Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

@diemol
Copy link
Member

diemol commented Jul 29, 2024

We are closing this issue as we didn't get a reply from the original poster.

If someone is having this issue, please feel free to comment and provide a concise reproducible test case that includes the page required to execute the scenario (a sample page or a public site).

If you have any questions or need help, join us in the IRC/Slack channel, where the community can also assist you.

@diemol diemol closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2024
@kkonopelko
Copy link

I have the same problem but only with chrome browser.
Writing automation tests with Selenium web driver(4.22), running on Windows 11, C#/.NET 8.

I had Selenium.WebDriver" Version="4.22.0" and Selenium.WebDriver.ChromeDriver" Version="126.0.6478.12600" in the solution of autotests. My Chromebrowser that installed on Windows had same version.

But 5 days ago my Chome browser on Windows got updated to the v = 127.0.6533.73 and tests start failed with issue: OpenQA.Selenium.NoAlertPresentException : no such alert (Session info: chrome=127.0.6533.73).

So, I did not change packages versions of selenium or ChromeDriver, updated only Chrome browser (not intentionally).

Test steps:

  1. Open application
  2. Go to some forms - make changes - try to refresh page
    Expected: browser alert is shows up
    Actual: no browser alert.

When I do same steps manually, the browser alert appears.

Also, I tried to update packages locally to selenium v 4.23 and driver = 127.0.6533.73. But it did not help.

Also I have anothe branch with tests, where I am trying new approach. And for that tests I run in the docker and with chrome-node 126 version. And no problem at all.

@GuillaumeBenini
Copy link

The issue seems to originate from here https://issuetracker.google.com/issues/42323796 and here w3c/webdriver#1294 (comment) where the W3C standard for user prompts wasn't applied correctly on Chromium and Firefox.

This is in reference to this spec https://w3c.github.io/webdriver/#user-prompts

Whenever active sessions is a list containing exactly one item, and that item is a HTTP session, but is not a BiDi session, then in the steps to fire beforeunload, implementations must act as if showing an unload prompt is likely to be annoying, deceptive, or pointless.
NOTE
This means that beforeunload prompts are never shown when there's an active HTTP-only session.

Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I-defect Something is not working as intended J-issue-template Applied to issues not following the template, or missing information.
Projects
None yet
Development

No branches or pull requests

4 participants