org.openqa.selenium.InvalidElementStateException:Cannot perform native interaction: Could not load native events component

StackOverflow https://stackoverflow.com/questions/9795868

質問

I was facing this error when working with version 2.15.0 and Firefox9 in Windows 7 using Java bindings, following an update of FF9 to FF10. I tried to disable native events as suggested online but no luck. After searching further for a solution online, I updated WebDriver to version 2.17.0. The issue was fixed and I did not face the same issue for sometime. Again I upgraded to the then latest version of WebDriver, 2.19.0 and the issue was solved. Now I face the same issue after an update of FF10 to 11. I upgraded to 2.20 but the issue prevailed. I disabled native events as below but I still get the error.

Using Java:

FirefoxProfile profile = new FirefoxProfile(); 
profile.setPreference("webdriver_enable_native_events", false); 
driver = new FirefoxDriver(profile); 

Stacktrace (when I try to move mouse to hover over an element):

org.openqa.selenium.InvalidElementStateException: Cannot perform native interaction: Could not load native events component. 
Command duration or timeout: 30.07 seconds
Build info: version: '2.20.0', revision: '16008', time: '2012-02-28 15:00:40'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_31' 
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
at java.lang.reflect.Constructor.newInstance(Unknown Source) 
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java: 170) 
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.­java: 123) 
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java: 438) 
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.MoveMouseAction.perform(MoveMouseAction.ja­va: 37) 
at org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.ja­va: 32) 
at org.openqa.selenium.interactions.Actions.perform(Actions.java:349) 
at com.requirementsLive.qa.utility.NavigateHelper.navigate_HoverPageTabs(Navig­ateHelper.java: 49) 

My code in NavigateHelper:

WebElement hoverMenu = uiHelper.waitForElementPresent(By.id(tabLocator), 10); 
Actions hoverAction = new Actions(this.getDriver()); 
hoverAction.moveToElement(hoverMenu); 
hoverAction.perform(); ------> line that throws the error 

Am I missing something? Is there a permanent fix to this in webdriver or should we upgrade to the latest webdriver (provided there's one) everytime there is an update to FF? (upgrade did not work this time).

Thanks.

役に立ちましたか?

解決

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.

他のヒント

I recommend to use firefox 9 or 10 as WebDriver 2.20.0 or 2.19.0 is not yet fully compatible with latest version of firefox.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top