Firefox 12.0 and Selenium 2 : Native Events are not supported
automated-tests, firefox, selenium, selenium-webdriver
Solution
Selenium 2.29.0 is released with the support for FF18 (for native events). Here is the link to update : http://selenium.googlecode.com/git/rb/CHANGES.
May be updating to FF18 and selenium-webdriver (2.29.0) may help you.
Problem
When running Selenium 2.21.0 build using the webdriver, I get the following error when running against Firefox 12.0 : ``` org.openqa.selenium.InvalidElementStateException: Cannot perform native interaction: Could not load native events component. Command duration or timeout: 20.08 seconds Build info: version: '2.2.1', revision: '16551', time: '2012-04-11 21:42:35' System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_26' Driver info: driver.version: RemoteWebDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:175) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:128) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:459) at org.openqa.selenium.remote.ExecuteMethod.execute(ExecuteMethod.java:47) at org.openqa.selenium.remote.RemoteMouse.mouseMove(RemoteMouse.java:89) at org.openqa.selenium.interactions.internal.MouseAction.moveToLocation(MouseAction.java:31) at org.openqa.selenium.interactions.ClickAndHoldAction.perform(ClickAndHoldAction.java:39) at org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121) at isishelper.ActionHelper.placement_placeSampleOnContainer(ActionHelper.groovy:195) ... ``` My code in this case is as follows : ``` List sourceSamples = sourceTable.findElements((By.className("x-grid-row"))) List poolTargets = driver.findElements(By.className("pool-box")) target = poolTargets[0] def source = sourceSamples[0] // Then drag and drop the sample to target (new Actions(driver)).dragAndDrop(source, target).perform() ``` I'm assuming this is missing functionality as Selenium 2.21 was released before Firefox 12.0, rather than an error setting up the driver on my part? Checking the driver properties : ``` driver.getCapabilities().asMap().each { index, value -> println("$index : $value") } ``` ``` browserName : firefox nativeEvents : false takesScreenshot : true version : 12.0 ``` But while creating the driver with a profile I get nativeEvents = true : ``` profile.setEnableNativeEvents(true); println profile.getProperties() driver = new FirefoxDriver(profile) ``` ``` [enableNativeEvents:true, class:class org.openqa.selenium.firefox.FirefoxProfile, additionalPreferences:org.openqa.selenium.firefox.Preferences@82d37] ```