Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Fitnesse in order to define some selenium tests. We got all of them running under CHROME but under FIREFOX some exceptions are arising. For running the tests I am using the external chrome webdriver. That is, I am using selenium-server 2.7.0 and starting it in the following way:

D:\projects\dev\jdk\1.6\bin\java -jar ./selenium-server-standalone-2.7.0.jar -\chromedriver\chromedriver.exe -Dfile.encoding=UTF8

__EXCEPTION__:org.openqa.selenium.InvalidElementStateException: Cannot perform native interaction: Could not load native events component.; duration or timeout: 2.05 seconds
Build info: version: '2.7.0', revision: '13926', time: '2011-09-23 13:24:59'
System info: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_16'
Driver info: driver.version: RemoteWebDriver; duration or timeout: 2.06 seconds
Build info: version: '2.7.0', revision: '13926', time: '2011-09-23 15:09:51'
System info: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_16'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.openqa.selenium.remote.ErrorHandler.createThrowable(
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at org.openqa.selenium.remote.ExecuteMethod.execute(
at org.openqa.selenium.remote.RemoteMouse.mouseMove(
at org.openqa.selenium.interactions.MoveMouseAction.perform(
at org.openqa.selenium.interactions.CompositeAction.perform(

That is, an exception InvalidElementStateException has been thrown and I do not understand what is wrong. The code is the same for Firefox and Chrome. Anybody has experienced this behavior?

Any hint would be appreciated.

Thanks in advance.

share|improve this question
Does this happen with every Firefox mouse interaction, or only sometimes? – user246 Oct 4 '11 at 16:26
What version of Firefox are you running? I had a similar issue running an older version of Firefox that was not supported, and you may run into problems with newer versions of Firefox that haven't been tested yet. – Sam Woods Oct 5 '11 at 16:42
The last one. 7.0.1 – Luixv Oct 6 '11 at 7:20
it might also be helpful if you give us the code it threw the exception for. – MacGyver Jan 22 '12 at 2:56

My guess is that your element is not present. the Click() method using the Firefox driver doesn't work like ClickAndWait in the Selenium IDE. You must explicitly do an implicit wait before you click on something. My guess is that you had 2 clicks right in a row, and it's failing on the second click because that element doesn't exist yet, because the first click submitted a form or something.

Call this method before the line of code that's failing. You'll need to find the Java implementation of this C# code, but I think it might solve your issue.

public static IWebElement FindElement(this IWebDriver driver, By by, int timeoutInSeconds)
    if (timeoutInSeconds > 0)
        var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(timeoutInSeconds));
        return wait.Until(drv => drv.FindElement(by));
    return driver.FindElement(by);
share|improve this answer

You can also follow this procedure.
First, copy your web-element in to a variable of type web-element:

webelement elem=driver.findElement("elementid"));

Now make the action by;

When DOM element changes, the id will not be same as the stack, so when a click action given after the element identification it will again check for the same element again.

This procedure can be used for possible exception like staleelementexception or elementnotfound.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.