Understanding of 'Cannot perform native interaction: Could not load native events component` with Firefox and Selenium Webdriver


Many times, while running automated Selenium tests on Firefox, people come across following error:

Selenium::WebDriver::Error::InvalidElementStateError: Cannot perform native interaction: Could not load native events component.`

Could someone help me to understand technically:

  1. What causes this error to occur?
  2. How is it solved with releasing new Selenium Webdriver version?
  3. Why it manifests only on Firefox, not with Chrome, IE?
  • You must to post comments

By default on Windows, the Firefox driver uses so-called “native events” for interacting with elements. That is to say, mouse and keyboard interactions are simulated using OS-level mechanisms, rather than the more common, but potentially limited and less accurate use of JavaScript to simulate the interaction. In the case of Firefox, this requires loading an OS-specific binary library (.so on Linux, .dll on Windows) compiled from C++ sources. These binary libraries must be linked to a specific version of the Gecko SDK, which means that they can only be loaded and used by specific versions of Firefox.

Since supporting every version of Firefox would bloat the driver significantly, the WebDriver team limits the number of versions any Selenium release will support. The current support policy for Firefox is to support the current Firefox release, the immediately prior Firefox release, the current Firefox Extended Support Release (ESR), and the immediately prior ESR release. Note that all versions are calculated at the date of release of the Selenium project.

Since a new Firefox release involves a new SDK, the Selenium project has to compile new native event components to support it, and release a new Selenium version with those components. The project tries to push a new release as closely as possible to the release of a new Firefox version, but since it’s an all-volunteer project, and since Mozilla can (and does!) change the Gecko SDK from version to version without warning, the Selenium update is sometimes delayed.

Two further points: First, the Firefox driver architecture is unique in this respect, so you won’t see this behavior in other browsers. It is important to note though that other browsers do require updated drivers to handle updated browser versions (cf. chromedriver.exe). Second, this architecture changes entirely when FirefoxDriver2, also called Marionette, is completed and released by Mozilla. The timetable for the release of Marionette is up to Mozilla, so one would have to contact them for any information about that.

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.