2013-02-22 104 views
0

我在使Selenium Grid演示正常工作時遇到問題。我嘗試按順序運行測試,儘管運行它們都失敗了,沒有啓動任何瀏覽器。我試圖用Firefox和Chrome來運行測試,並且兩次都得到了相同的結果。Selenium Grid演示失敗

我也跟着上的所有指令這個page(入門)和安裝Java jdk1.7.0_15apache-ant-1.8.4selenium-grid-1.0.8(這顯然是當前release,雖然我已經看到了Grid2提到?)。

我能夠成功運行命令

ant sanity-check

,並有電網編譯。然後我移動到demo page

ant launch-hub

,我能夠在本地主機,查看輪轂:4444 /控制檯

ant launch-remote-control

,我看到可用的瀏覽器出現在我的樞紐。

當運行

ant run-demo-in-sequence

可用遙控器現在顯示爲在輪轂的主動控制和運行的測試,但所有4失敗。 Firefox無法打開,也沒有看到任何新的瀏覽器打開。

當我瀏覽到target/reports/index.html頁面(位於電網目錄),我能夠找到下面的錯誤,這是每一個失敗的試驗一樣:

java.lang.RuntimeException: Could not start Selenium session: ERROR: Could not retrieve a new session at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89) at com.thoughtworks.selenium.grid.tools.ThreadSafeSeleniumSessionStorage.startSeleniumSession(ThreadSafeSeleniumSessionStorage.java:26) at com.thoughtworks.selenium.grid.demo.WebTestForASingleBrowser.domme(WebTestForASingleBrowser.java:51) at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217) at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152) at org.apache.tools.ant.taskdefs.Java.run(Java.java:771) at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221) at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135) at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:392) at org.apache.tools.ant.Target.performTasks(Target.java:413) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:811) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: com.thoughtworks.selenium.SeleniumException: ERROR: Could not retrieve a new session at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97) at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91) at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262) at com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProcessor.java:223) at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:81) ... 50 more ... Removed 29 stack frames

,而在輸出其中,我公司推出的測試CMD窗口原文:

run-demo-in-sequence: 
    [java] [Parser] Running: 
    [java] Selenium Grid Demo In Sequence 
    [java] 
    [java] 
    [java] =============================================== 
    [java] Selenium Grid Demo In Sequence 
    [java] Total tests run: 4, Failures: 4, Skips: 0 
    [java] =============================================== 
    [java] 

BUILD FAILED 
C:\Program Files\selenium-grid-1.0.8-bin\selenium-grid-1.0.8\build.xml:116: Java 
returned: 1 

Total time: 1 minute 33 seconds 

Firefox版本是18.0.2。另外,我也看到了Selenium-standalone ..在其他類似的問題中提到過,但在我正在遵循的教程的任何地方都沒有提及,我需要嗎?

任何人都可以幫助演示工作,並解釋我要去哪裏錯了嗎?

回答