搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Changing textfield value does not trigger events when window is unfocused

more options

Hi,

I'm using Selenium Webdriver to test in Firefox, and I started encountering some strange behavior that I was hoping to get some more information about.

What should happen: 1. Text field gets filled with some value 2. On focus leaving the field (click away or tab), a label on the same page should be updated based on the value from the text field

Manually, this works just fine. When using Selenium Webdriver and the Firefox main window isn't focused/active (let's say, behind a terminal window), the event on focus-change does not fire, and the label does not get updated. In Chrome, this seems to work fine.

Do you have any idea what might be triggering different behavior based on the Firefox window being active?

Thanks, Connor

Hi, I'm using Selenium Webdriver to test in Firefox, and I started encountering some strange behavior that I was hoping to get some more information about. What should happen: 1. Text field gets filled with some value 2. On focus leaving the field (click away or tab), a label on the same page should be updated based on the value from the text field Manually, this works just fine. When using Selenium Webdriver and the Firefox main window isn't focused/active (let's say, behind a terminal window), the event on focus-change does not fire, and the label does not get updated. In Chrome, this seems to work fine. Do you have any idea what might be triggering different behavior based on the Firefox window being active? Thanks, Connor

所有回覆 (1)

more options

Hi Connor, I'm not a Selenium user and this might not be the best place to get support for this issue.

Is this a new issue in Firefox 42 or can you determine when it started? Does it persist in Firefox 45?

Does Firefox's Browser Console show any error messages when you "tab" out of the field in a background window that it does not show when you "tab" out of the field in a focused window?

Firefox does have a concept of trusted vs. untrusted keyboard events, but I don't know whether the window being active vs. not active is a consideration.