我正在使用 Fitnesse 来定义一些硒测试。我们让它们都在 CHROME 下运行,但在 FIREFOX 下会出现一些例外情况。为了运行测试,我使用了外部 chrome webdriver。也就是说,我正在使用 selenium-server 2.7.0 并以下列方式启动它:
D:\projects\dev\jdk\1.6\bin\java -jar ./selenium-server-standalone-2.7.0.jar - Dwebdriver.chrome.driver=c:\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: os.name: '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: os.name: '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(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:147)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:113)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:397)
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.java:37)
at org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.java:32)
at com.bmw.next.selenium2.util.MouseUtil.moveToElement(MouseUtil.java:22)
....
也就是说,抛出了异常InvalidElementStateException,我不明白出了什么问题。Firefox 和 Chrome 的代码相同。有人经历过这种行为吗?
任何提示将不胜感激。
提前致谢。