簡體   English   中英

沒有可用的瀏覽器,但需要采取措施嗎?

[英]No browsers available, yet actions requested?

嘗試使用JsTestDriver捕獲瀏覽器時出現此錯誤:

java.lang.RuntimeException: No browsers available, yet actions [com.google.jstestdriver.RunTestsAction@5427ee05] requested. If running against a persistent server please capture browsers. Otherwise, ensure that browsers are defined.
    at com.google.jstestdriver.browser.BrowserActionExecutorAction.run(BrowserActionExecutorAction.java:94)
    at com.google.jstestdriver.ActionRunner.runActions(ActionRunner.java:81)
    at com.google.jstestdriver.embedded.JsTestDriverImpl.runConfigurationWithFlags(JsTestDriverImpl.java:342)
    at com.google.jstestdriver.embedded.JsTestDriverImpl.runConfiguration(JsTestDriverImpl.java:233)
    at com.google.jstestdriver.Main.main(Main.java:70)

基本上,我正在做以下事情:

  1. 使用以下方法啟動JsTestDriver服務器:

    nohup java -jar JsTestDriver-1.3.5.jar --port 9876> jstd.out 2> jstd.err </ dev / null和

  2. 然后,我嘗試使用以下方法捕獲瀏覽器:

    nohup ./phantomjs phantomjs-jstd.js> phantomjs.out 2> phantomjs.err </ dev / null和

  3. 最后,我嘗試使用以下命令運行測試:

    java -jar JsTestDriver-1.3.5.jar --server http:// localhost:9876 --config ../../jsTestDriver.conf-測試所有

我必須說,這是在將我擁有的Ubuntu服務器從11.10更新到12.04之后發生的。 這可能有助於弄清我在這里遇到的問題。

我不知道發生了什么...

順便說一句,我已經訪問了鏈接http:// localhost:9876,並且得到了以下輸出HTML:

 <html> <head> <title>JsTestDriver</title> <script> function getEl(id){return document.getElementById(id);}function toggle(id) { if (getEl(id).style.display=='block') {getEl(id).style.display='none';} else {getEl(id).style.display='block';}} </script> </head> <body> <a href="/capture">Capture This Browser</a> <br/> <a href="/capture?strict">Capture This Browser in strict mode</a> <br/> <p><strong>Captured Browsers: (0)</strong></p> </body> </html> 

這說明存在錯誤,因為沒有清晰的瀏覽器。

編輯

在其他機器(Fedora 21)上嘗試時,我已成功執行了所有操作。 運行第二個命令時,我得到的輸出是另一個,它試圖捕獲瀏覽器。 我得到的輸出是這個:

Wed Apr 13 2016 12:46:33 GMT+0200 (CEST): Attempting (1) to load: http://localhost:9876/capture
Wed Apr 13 2016 12:46:34 GMT+0200 (CEST): Finished loading http://localhost:9876/capture with status: success

現在訪問URL http:// localhost:9876時,我看到有一個Captured瀏覽器。 仍然不知道在Ubuntu 12.04服務器中會發生什么。

好了,經過一整天的反復試驗,我終於得到了自己的問題的答案。 我已經下載了PhantomJS,並用新的替換了以前的二進制文件。 運行PhantomJS時,無論我做什么,輸出都是空的。 甚至“ phantomjs --version”也使其意外退出。

奇怪的是,我在Fedora 21中使用了“損壞的”二進制文件,在將Ubuntu升級到12.04之前,它在Ubuntu 11.10中也能很好地工作。

問題解決了!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM