2015-10-14 70 views
0

使用時,我想用實習生使用phantomJS進行功能測試。幻影JS配置與InternJS

  • 我安裝了phantomJS並運行命令「phantomjs --webdriver 4444」,它運行成功。
  • 然後試圖運行實習生澆道用命令「實習生澆道配置=測試/實習生」 -file測試/實習生是在後的端部示出。

,但我不斷收到錯誤

intern-runner config=tests/intern 
Listening on 0.0.0.0:9000 
Tunnel started 
Suite phantomjs on any platform FAILED 
UnknownError: [POST http: //localhost:4444/wd/hub/session/{"desiredCapabilities":{"browserName":"phantomjs","name":"tests/intern","idle-timeout":60}}] An unknown server-side error occurred while processing the command. 

的實習生。

和phantomjs 錯誤

[ERROR - 2015-10-14T10:14:35.611Z] RouterReqHand - _handle.error - {"message":"{ 
\"headers\":{\"Connection\":\"close\",\"Host\":\"localhost:4444\",\"accept\":\"a 
pplication/json,text/plain;q=0.9\",\"content-length\":\"91\",\"content-type\":\" 
application/json;charset=UTF-8\",\"user-agent\":\"dojo/2.0.0-dev Node.js/4.1.2\" 
},\"httpVersion\":\"1.1\",\"method\":\"POST\",\"url\":\"/session\",\"urlParsed\" 
:{\"anchor\":\"\",\"query\":\"\",\"file\":\"session\",\"directory\":\"/\",\"path 
\":\"/session\",\"relative\":\"/session\",\"port\":\"\",\"host\":\"\",\"password 
\":\"\",\"user\":\"\",\"userInfo\":\"\",\"authority\":\"\",\"protocol\":\"\",\"s 
ource\":\"/session\",\"queryKey\":{},\"chunks\":[\"session\"]}}","name":"Missing 
Command Parameter","line":85,"sourceId":65775352,"sourceURL":":/ghostdriver/req 
uest_handlers/session_manager_request_handler.js","stack":"Missing Command Param 
eter: {\"headers\":{\"Connection\":\"close\",\"Host\":\"localhost:4444\",\"accep 
t\":\"application/json,text/plain;q=0.9\",\"content-length\":\"91\",\"content-ty 
pe\":\"application/json;charset=UTF-8\",\"user-agent\":\"dojo/2.0.0-dev Node.js/ 
4.1.2\"},\"httpVersion\":\"1.1\",\"method\":\"POST\",\"url\":\"/session\",\"urlP 
arsed\":{\"anchor\":\"\",\"query\":\"\",\"file\":\"session\",\"directory\":\"/\" 
,\"path\":\"/session\",\"relative\":\"/session\",\"port\":\"\",\"host\":\"\",\"p 
assword\":\"\",\"user\":\"\",\"userInfo\":\"\",\"authority\":\"\",\"protocol\":\ 
"\",\"source\":\"/session\",\"queryKey\":{},\"chunks\":[\"session\"]}}\n at : 
/ghostdriver/request_handlers/session_manager_request_handler.js:85\n at :/gh 
ostdriver/request_handlers/session_manager_request_handler.js:44\n at :/ghost 
driver/request_handlers/router_request_handler.js:70","stackArray":[{"sourceURL" 
:":/ghostdriver/request_handlers/session_manager_request_handler.js","line":85}, 
{"sourceURL":":/ghostdriver/request_handlers/session_manager_request_handler.js" 
,"line":44},{"sourceURL":":/ghostdriver/request_handlers/router_request_handler. 
js","line":70}]} 

- 運行實習生-runner-後出現此錯誤。

沒有人知道是什麼問題?

p.s.我使用phantomJS v.1.9.8


tests/intern : 

define({ 
proxyPort: 9000, 
proxyUrl: 'http://localhost:9000/', 
environments: [ 
    { browserName: 'phantomjs' } 
], 
maxConcurrency: 3, 
useSauceConnect: false, 
loaders: { 
    'host-browser': 'node_modules/requirejs/require.js' 
}, 
tunnel: 'NullTunnel', 
functionalSuites: [ 'tests/functional/modetest' ], 

}); 
+0

「缺少命令參數」看起來像實習生或錯誤,這包括在PhantomJS不兼容的版本Ghostdriver。您使用的是什麼PhantomJS版本?這可能更適合作爲實習項目的錯誤報告。 –

+0

的phantomJS版本是1.9.8,我編輯的問題包含此信息 –

回答

1

PhantomJS 1是古老的(它使用WebKit版本從2012年),而不是支持。你必須在實習生身上使用PhantomJS 2+。

+0

謝謝,我使用phantomJS2嘗試,這一次實習生正常啓動,但隨後返回'CancelError:上phantomjs'超時達,和phantomJS返回不同的錯誤'[錯誤 - 2015-10-15T07:29:36.643Z] RouterReqHand - _handle.error - { 「名」: 「INVA蓋命令法」 ......:262 error',任何知道這意味着什麼? –

+0

有關於此的任何更新? @hassan ......我遇到了Intern 3和Phantom 2的相同問題。 –

+0

不,這個任務被凍結了,我切換到另一個任務。但這個問題基本上已經死了。你應該開始另一個問題 –