0

我正在使用 WebDriver 运行 Arquillian Graphene (2.0.0.Alpha3),但结果不一致。有时,我的 JUnit 测试会毫无问题地通过,有时我会收到如下错误:

12:13:29.667 WARN - Exception thrown
org.openqa.selenium.WebDriverException: ReferenceError: Graphene is not defined
Command duration or timeout: 946 milliseconds
Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 20:21:18'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_30'
Session ID: 6dce0406-d50d-46d9-8e28-01f159a593b7
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=10.0.12, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}]
    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:187)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:533)
    at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:441)
    at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:101)
    at $Proxy1.executeScript(Unknown Source)
    at org.openqa.selenium.support.events.EventFiringWebDriver.executeScript(EventFiringWebDriver.java:209)
    at org.openqa.selenium.remote.server.handler.ExecuteScript.call(ExecuteScript.java:55)
    at org.openqa.selenium.remote.server.handler.ExecuteScript.call(ExecuteScript.java:1)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

似乎大多数问题都发生在请求保护上。例如:

guardXhr(_acceptButton).click();

可能是什么原因?有没有办法调试或解决这个问题?

4

1 回答 1

1

这被确认是 2.0.0.Alpha3: ARQGRA-262中的一个错误。

有一个可用的修复程序,并且似乎可以使用最新的 2.0.0.Beta1-SNAPSHOT。

于 2013-02-07T01:00:46.373 回答