-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
synthetic events do not generate focus
and blur
unless FF is the topmost window
#825
Comments
Fixed by commit 0eec81d |
I've cloned the latest version of Selenium available on Github (default branch: So from my perspective, the commit you've referenced in your comment does fix #862 and #813 but it does not fix this issue. |
@barancev Going back to FF2 Firefox has had logic where it won't process focus or blur events when the app is not active. For linux this can be "fixed" with FirefoxProfile#setAlwaysLoadNoFocusLib AFAIK there is no work around for Windows. |
I'm not sure about blur and focus events. I just ran the scenario from this issue (translated to Java) and got the result that is described as "expected" above. I'll retest tomorrow. |
I've run into this problem again and narrowed it down to a much simpler case:
Run it with Reminder: using Expected outputEach run of
It shows that I get the expected output if I run the test with Selenium 2.45.0 and I edit the code to turn off the launch of
Actual outputWhen using synthetic events and FF is not the topmost window, then the For instance with Selenium 2.45.0 with FF not the topmost window (
Or with Selenium 2.48, it is even worse. Even with FF 31.8 we get the bad results because somehow 2.48 is unable to turn on native events on FF 31.8:
|
I checked out whether
And the library is actually mapped in the process' space:
Is there something additional that needs to be triggered to get the library activated in the executable? |
I can reproduce the issue in Java. It's been ages since I've worked with Java, so it is not impossible I'm doing funky stuff but here is the code:
Output with 2.45.0:
Output with 2.48.2:
I've also tried with:
and passed |
Adding this before clicking on
|
Works in Firefox ESR 52 + legacy Firefox driver, tested in Selenium 3.5.2, added regression tests by 30ebe6e This issue is actual for geckodriver, follow mozilla/geckodriver#906 |
Well, it may still fail in legacy Firefox driver (especially on Linux), but it's not going to be fixed there anyway. |
Versions
Selenium version: 2.45.0, 2.46.1
Browser: FF 34
OS: Debian Testing up to date as of 2015-07-23
What steps will reproduce the problem?
To get the whole script to run you should run it on 2.45.0. See notes below regarding 2.46.0.
This code reproduces the problem 100% of the time here:
Save the script as
issue.py
. Edit the script so that the path given for the Firefox binary for which native events can be produced is set to a path that works on your system, and run:$ xvfb-run python ./issue.py
xvfb-run
is used to isolate the run from other applications running. If you just run it on your usual desktop, you may not get the results above due to window manager interference or some other factor.What is the expected output?
Synthetic events should produce the same browser behavior as native events.
What do you see instead?
The main problem here is that
focus
andblur
events are not generated, so elements that should become visible on the screen do not become visible.Observations
It is not possible to run the whole script with Selenium 2.46.0. The script is designed to show how the behavior of native events and synthetic events differ, with native events providing exactly what a developer would expect. Because 2.46.0 does not support native events on FF 34, the attempt at running with native events fails. However, it is possible to run the script in 2.46.0 and see the incorrect behavior provided by synthetic events, which is the same as in 2.45.0.
Running the script with
xvfb-run
and launching anxterm
instance so that Firefox is not the topmost window is a means to get 100% reproducibility. On my own desktop here (Gnome) I can readily reproduce the problem if I just runpython ./issue.py
, and even if Firefox looks like it is the topmost window. However, I found that if I start playing with the mouse while the test runs, reproducibility is not guaranteed.Running the script with Chrome 44 (and chromedriver 2.16) produces the expected output, except for the fact that we get
NATIVE: True
in both runs given that it is not possible to turn off native events in Chrome. I'm not equipped to try to mimic what I'm doing in X11 in a Windows or Mac OS environment but I'd expect native events there too to work perfectly like they do in Chrome 44.I'm reporting the bug as requested here.
The text was updated successfully, but these errors were encountered: