-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[🐛 Bug]: Regression in selenium/standalone-firefox between 123.0 and 124.0+ related to confirmation dialog with onbeforeunload #2215
Comments
@surli, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
For the record I had to redact a bit the logs I had because it was too large to fit in the issue, full logs is available there: https://up1.xwikisas.com/#p8oLkDbzeapdtETj-lzrAQ |
In your logs, there was something relates to http_res 404 on the session request on alert 13:47:35.105 [docker-java-stream-1267231176] INFO o.x.t.d.i.j.XWikiDockerExtension - STDOUT: 13:47:35.104 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "3d1719d01dbae017914382adaa829dc6","eventTime": 1713440855104671966,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.remote.http.Route$PredicatedRoute","http.host": "localhost:32997","http.method": "GET","http.request_content_length": "0","http.scheme": "HTTP","http.status_code": 404,"http.target": "\u002fsession\u002f0bfc00b8-9638-4f48-a14a-80f20d494736\u002falert\u002ftext","http.user_agent": "selenium\u002f4.19.1 (java unix)"}} @diemol, do you think this is the same with issue is being discussed in SeleniumHQ/selenium#13769 ? |
This 404 is actually expected here, I'm actually accessing a page that doesn't exist in first line of my test here: https://github.com/xwiki/xwiki-platform/pull/3072/files#diff-6f6ed5d55aabf4072ff0345749be90154061c164af88505ec531abf78b342b50R178 so it's not related to a problem in Selenium AFAIK. I can try to run the test again with an existing page so that the logs are less confusing. |
What happens when you execute your test outside Docker and using Firefox 124? |
Well I haven't the setup for running the test outside of docker on firefox 124 :-/ I would need to write the test outside of our framework and have a machine with Firefox 124 installed, which I don't have right now (already upgraded to Firefox 125 locally). I did try few weeks ago to execute manually the operations on the browser (so without selenium automation) when I was running Firefox 124.0: back then I wasn't reproducing the issue manually, meaning that the |
It sounds like it is an issue with Firefox 124. I just wanted to rule out that the issue comes because it is running inside a container. |
Hi, is there any more investigation on this? We're still impacted even if we keep using the |
We have not done anything related to this. So we need a way to reproduce the issue to understand if this happens on Firefox or Firefox inside Docker. My question above is still valid, have you tried to verify this on Firefox outside Docker? |
I haven't I'd need help to write a simple script for doing that properly. |
Below is a simple test I wrote to run on non-docker env. It passed on driver.Chrome(). However, didn't pass on Firefox (even FF <= v123.0) with env is Windows, binding Python 4.18.0+. How about the binding version in your test? from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import time
def open_url():
driver = webdriver.Firefox()
driver.get("https://www.selenium.dev/blog/2024/selenium-4-21-released/")
driver.execute_script("window.onbeforeunload = function () { return false; }")
link = driver.find_element(By.XPATH, "//a[text()='@diemol']")
link.click()
time.sleep(20)
alert = WebDriverWait(driver, 3).until(EC.alert_is_present())
alert.accept()
driver.quit()
if __name__ == "__main__":
open_url() |
I will check for the binding, but FYI when I wrote my own test for exposing the bug (in xwiki/xwiki-platform#3072) I remember that I had problems to expose it when just clicking on a link: I had to click on a button which was part of a form to get the actual confirmation dialog in the test with firefox. |
We're using selenium-java 4.21.0 |
@diemol, what do you think on this case? |
@surli can you share the test to reproduce this? |
I mean, @VietND96 tried it, and it seems it is a Firefox issue. But to discard that it is not a Selenium issue, it would be great to see what your test looks like. |
My test is in this PR: xwiki/xwiki-platform#3072 I'm using some java page object wrapping selenium API but it's basically doing same as @VietND96 snippet:
|
Got it. Based on that, I would suggest to report the issue to Mozilla. I will share the link where you can do it in a moment. |
Hi, @surli. You can see if the feature is passing in the Web Platform Tests. If it is something new, please create an Issue with the GeckoDriver team. Feel free to comment the issues that you raise back in this issue. Thank you. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What happened?
selenium/standalone-firefox
docker image only. We're using the Java selenium dependency and we're running our tests using TestContainer on our side.We have tests in our platform that are checking the behaviour of some editors and in particular that leaving the page without saving changes triggers a prompt in the browser asking confirmation before leaving. Nothing fancy here we're using some javascript code with a listener on a
beforeunload
event: the code on our side haven't change for a while.But we recently noticed that those tests started to fail, on firefox only: we're also testing with chromium and on chromium tests are still succeeding.
After investigating a bit more, I discovered that when using
selenium/standalone-firefox:123.0
tests are succeeding, but not when usingselenium/standalone-firefox:124.0
(or124.0.1
or124.0.2
). Now I tried to manually reproduce the steps on my own firefox (currently on 124.0.2) and I wasn't able to reproduce the bug.I also tried to write a simple test for reproducing the problem, sadly it was more difficult than I thought. I came up with the following test: https://github.com/xwiki/xwiki-platform/pull/3072/files
Basically the idea of the test is to open a page which contains a link to another page, execute the following javascript:
click on the link and wait for an alert to appear thanks to
driver.waitUntilCondition(ExpectedConditions.alertIsPresent());
.This test fails with a timeout on the wait only with selenium/standalone-firefox:124.0+.
At this point I also tried to check if it could be a bug in firefox itself, but I haven't found anything in the bug tracker, and the release change of Firefox 124.0 didn't gave me any hint so far.
Also to give all details we're using
4.19.1
for the selenium version.Command used to start Selenium Grid with Docker (or Kubernetes)
We don't run directly docker selenium: we're using selenium docker images through TestContainer.
Relevant log output
Operating System
Ubuntu
Docker Selenium version (image tag)
4.19.1
Selenium Grid chart version (chart version)
No response
The text was updated successfully, but these errors were encountered: