2017-06-20 59 views
0

我試圖運行測試,在Firefox瀏覽器中出現空白屏幕,當我關閉窗口時,出現以下錯誤。如何在量角器測試中運行Firefox?

版本 火狐:45.5.1 硒獨立:3.4.0 Chromedriver 2.30 Geckodriver v0.17.0

[10:10:40] W/driverProviders - Using driver provider directConnect, but also found extra driver provider parameter(s): seleniumAddress 
    [10:10:40] I/launcher - Running 1 instances of WebDriver 
    [10:10:40] I/direct - Using FirefoxDriver directly... 
    [10:11:06] E/launcher - Unable to parse new session response: {"value": {"error": "unknown error","message":"Failed to decode response from marionette","stacktrace":"stack backtrace:\n 0: 0x4bd56f - <no info>\n 1: 0x4b 
    dcc9 - <no info>\n 2:   0x449980 - <no info>\n 3:    0x4207bc 
    - <no info>\n 4:   0x405e47 - <no info>\n 5:    0x6db3d9 - < 
    no info>\n 6:   0x417847 - <no info>\n 7:   0x6d56d3 - <no i 
nfo>\n 8:   0x77a359cd - BaseThreadInitThunk"}} 
    [10:11:06] E/launcher - WebDriverError: Unable to parse new session response: {" 
value":{"error":"unknown error","message":"Failed to decode response from marion 
ette","stacktrace":"stack backtrace:\n 0:   0x4bd56f - <no   info>\n 1 
:   0x4bdcc9 - <no info>\n 2:   0x449980 - <no info>\n 3: 
    0x4207bc - <no info>\n 4:   0x405e47 - <no info>\n 5: 
0x6db3d9 - <no info>\n 6:   0x417847 - <no info>\n 7: 
0x6d56d3 - <no info>\n 8:   0x77a359cd - BaseThreadInitThunk"}} 
at WebDriverError (C:\npm\node_modules\protrac 
    tor\node_modules\selenium-webdriver\lib\error.js:27:5) 
at doSend.then.response (C:npm\node_modules\p 
rotractor\node_modules\selenium-webdriver\lib\http.js:445:19) 
    at process._tickCallback (internal/process/next_tick.js:103:7) 
From: Task: WebDriver.createSession() 
at Function.createSession (C:\npm\node_modules 
\protractor\node_modules\selenium-webdriver\lib\webdriver.js:777:24) 
at Function.createSession (C:\npm\node_modules 
\protractor\node_modules\selenium-webdriver\firefox\index.js:640:55) 
    at Direct.getNewDriver (C:\node_modules\pr 
    otractor\lib\driverProviders\direct.ts:112:25) 
at Runner.createBrowser (C:\node_modules\p 
    rotractor\lib\runner.ts:225:39) 
at q.then.then (C\Users\node_modules\protractor 
\lib\runner.ts:391:27) 
at _fulfilled (C:\node_modules\protractor\ 
node_modules\q\q.js:834:54) 
at self.promiseDispatch.done (C:\node_modu 
les\protractor\node_modules\q\q.js:863:30) 
at Promise.promise.promiseDispatch (C:\nod 
e_modules\protractor\node_modules\q\q.js:796:13) 
at C:\node_modules\protractor\node_modules 
\q\q.js:556:49 
at runSingle (C:\node_modules\protractor\n 
ode_modules\q\q.js:137:13) 
[10:11:06] E/launcher - Process exited with error code 199 

Conf.js

exports.config = { 
seleniumAddress: 'http://127.0.0.1:4444/wd/hub', 
    baseUrl: 'https://localhost:288020/', 
    specs: ['index_spec.js'], 
     directConnect: true, 
capabilities: { 
'browserName': 'firefox' 
} 
}, 
framework: 'jasmine2', 
jasmineNodeOpts: { 
defaultTimeoutInterval: 30000 
}, 
onPrepare: function() { 
browser.driver.manage().window().setSize(1366, 768); 
}}; 

回答

1

您需要使用最新版本的Firefox(至少大於51)使用Selenium 3.4和新的Firefox(Gecko)驅動程序。如果你升級到最新,你會看到它會工作

+0

謝謝,我會給一個去。 –

0

從硒3.4開始,你不能測試舊的Firefox版本 如果你使用硒版本3.01,3.1或3.2,那麼你仍然可以測試舊的Firefox,即使你運行硒3.

  • 火狐48+:所需的硒版本3.0.1+
  • 火狐47:僅適用於硒版本2.53.1
  • 火狐46:2.51.0 2.52.0 2.53.0
  • Firefox 44-45:2.48.2,2.49.0,2.51.0,2.52。 0,2.53.0
  • 火狐39 - 43:2.47.1,2.48.2,2.49.0,2.51.0,2.52.0,2.53.0
  • 火狐38:2.46.0
  • 32火狐 - 37:2.45.0
+0

我試圖降級硒獨立。我下載了舊的jar並放入了文件夾,但是當我試圖運行webdriver-manager啓動時,它仍然捕獲新的並且說它找不到它。因此,如何手動更改爲新的。任何想法都會非常有幫助。 –

0

您可以通過改變量角器的config.json文件更改版本的webdriver經理下載:

  • 編輯量角器的配置文件: node_modules /量角器/ config.json
  • 將硒版本更改爲任何您需要的。例如。 「硒」:「2.47.1」
  • 運行的webdriver經理更新
相關問題