-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
I'm having an issue with clicking on a button in some very narrow circumstance from Selenium.
The button is a form save button (it's submits a form but via javascript so is not a submit button) so we use WebElement.click()
Everything pretty works as expected. However there is a case where if one element in the form currently has focus then when it looses focus it does some client side javascript validation to show / clear an inline warning.
The problem we have is that in this case the click on the "save" never appears to happen. If we sleep after the button.click and perform another click on the same WebElement (object reference) then things work.
This issue only occurs in Firefox, not Chrome.
enabling debug logs in selenium/geckodriver shows the following
1756225604628 webdriver::server DEBUG <- 200 OK {"value":true}
1756225604630 webdriver::server DEBUG -> POST /session/c6803ae7-2a49-45f8-8b52-08de41f8ed82/element/b78fc7c6-28c0-424e-8942-13cfbd4ff548/click {
"id": "b78fc7c6-28c0-424e-8942-13cfbd4ff548"
}
1756225604630 Marionette DEBUG 0 -> [0,443,"WebDriver:ElementClick",{"id":"b78fc7c6-28c0-424e-8942-13cfbd4ff548"}]
1756225605134 RemoteAgent WARN TimedPromise timed out after 500 ms: stacktrace:
TimedPromise/<@chrome://remote/content/shared/Sync.sys.mjs:448:24
TimedPromise@chrome://remote/content/shared/Sync.sys.mjs:432:10
interaction.flushEventLoop@chrome://remote/content/marionette/interaction.sys.mjs:465:10
webdriverClickElement@chrome://remote/content/marionette/interaction.sys.mjs:218:33
1756225605185 Marionette DEBUG 0 <- [1,443,null,{"value":null}]
firefox: 142.0.1 (64-bit) (windows 11)
geckodriver: 0.36.0 (a3d508507022 2025-02-24 15:57 +0000)
Steps to reproduce.
- Install Java 17 (or 21) and Maven (3.9)
- clone https://github.com/jenkinsci/acceptance-test-harness/
- fetch Selenium bump jenkinsci/acceptance-test-harness#2137 (and use commit sha
7bd27723e17c75178ad784ef8bc4660c80a3e8ab
) - ensure you have a docker deamon (configured to use linux containers).
- download Jenkins https://get.jenkins.io/war-stable/2.516.2/jenkins.war
export BROWSER=firefox
export JENKINS_JAVA_OPTS=-Xmx1280m
export JENKINS_WAR=jenkins.war
(use the path to Jenkins downloaded earlier)- run maven with the specific test
mvn test -Dtest=GitPluginTest#calculate_changelog
- with enabling debuggin on the geckodriver you can observe the stack above.