2017-02-14 38 views
0

試圖運行我非常簡單的測試套件,我終於開始建造出來 - 我收到這當中的錯誤日誌:量角器無法在Firefox上運行(在Chrome中正常工作)

WebDriverError: Firefox option was set, but is not a FirefoxOption: {} 

我運行以下版本:

  • 節點V7.5.0
  • 量角器V5.1.1
  • 硒的webdriver V3.0.1
  • 火狐v45.0.1現在v51.0.1

完全錯誤轉儲:

[00:44:20] I/testLogger - [firefox #11] PID: 77949 
[firefox #11] Specs: /Users/meetbryce/Dropbox (Personal)/Code/Projects/HelloMetrics/utm-link-manager/protractor/auth/login.spec.js 
[firefox #11] 
[firefox #11] (node:77949) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. 
[firefox #11] [00:44:20] I/hosted - Using the selenium server at http://localhost:4444/wd/hub 
[firefox #11] 
[firefox #11] /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:505 
[firefox #11]   throw new ctor(message); 
[firefox #11]    ^
[firefox #11] WebDriverError: Firefox option was set, but is not a FirefoxOption: {} 
[firefox #11] Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700' 
[firefox #11] System info: host: 'bryceyork.local', ip: '10.40.66.60', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.1', java.version: '1.8.0_91' 
[firefox #11] Driver info: driver.version: FirefoxDriver 
[firefox #11]  at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:505:15) 
[firefox #11]  at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13) 
[firefox #11]  at doSend.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:440:13) 
[firefox #11]  at process._tickCallback (internal/process/next_tick.js:103:7) 
[firefox #11] From: Task: WebDriver.createSession() 
[firefox #11]  at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:777:24) 
[firefox #11]  at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/firefox/index.js:640:55) 
[firefox #11]  at createDriver (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:167:33) 
[firefox #11]  at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:629:16) 
[firefox #11]  at Hosted.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:52:33) 
[firefox #11]  at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:194:43) 
[firefox #11]  at q.then.then (/usr/local/lib/node_modules/protractor/built/runner.js:338:29) 
[firefox #11]  at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54) 
[firefox #11]  at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30) 
[firefox #11]  at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13) 

[00:44:20] I/testLogger - 

[00:44:20] E/launcher - Runner process exited unexpectedly with error code: 1 
[00:44:20] I/launcher - 1 instance(s) of WebDriver still running 
..[00:44:27] I/testLogger - 
------------------------------------ 

[00:44:27] I/testLogger - [chrome #01] PID: 77948 
[chrome #01] Specs: /Users/meetbryce/Dropbox (Personal)/Code/Projects/HelloMetrics/utm-link-manager/protractor/auth/login.spec.js 
[chrome #01] 
[chrome #01] (node:77948) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. 
[chrome #01] [00:44:20] I/hosted - Using the selenium server at http://localhost:4444/wd/hub 
[chrome #01] Started 
[chrome #01] log: [] 
[chrome #01] log: [] 
[chrome #01] 
[chrome #01] 
[chrome #01] 
[chrome #01] 2 specs, 0 failures 
[chrome #01] Finished in 5.816 seconds 
[chrome #01] 

[00:44:27] I/testLogger - 

[00:44:27] I/launcher - 0 instance(s) of WebDriver still running 
[00:44:27] I/launcher - firefox #11 failed with exit code: 1 
[00:44:27] I/launcher - chrome #01 passed 
[00:44:27] I/launcher - overall: 1 process(es) failed to complete 
[00:44:27] E/launcher - Process exited with error code 100 

Process finished with exit code 100 

下面是我的情況下,量角器配置這一點很重要:

exports.config = { 
    framework: 'jasmine', 
    seleniumAddress: 'http://localhost:4444/wd/hub', 
    specs: ['**/*.spec.js'], 
    multiCapabilities: [ 
     { 
      'browserName': 'chrome', 
      'loggingPrefs': { 
       'driver': 'WARNING', 
       'server': 'WARNING', 
       'browser': 'SEVERE' 
      } 
     }, 
     { 
      'browserName': 'firefox' 
     } 
    ] 
}; 
+2

試試這個: '功能:{browserName:'firefox',marionette:false}' – FCin

+0

@FCin似乎已經完成一些東西。現在雖然你可能不會使用傳統FirefoxDriver的自定義命令執行程序作爲錯誤... –

回答

1

有完全相同的問題。 今天推出了「webdriver的經理更新」 然後一切正常

編輯: update command

+1

總是建議您在答案中添加詳細信息;這種情況下的更新細節。 –

+1

沒想到有必要解釋如何啓動cmd命令,但它在這裏! 感謝您填寫我的禮儀套餐 –

-2

添加在你的conf文件中的以下

capabilities: {browserName: 'firefox'} 
+0

它已經存在了...... –

0

對於任何版本的Firefox V48下面你需要與傳統FirefoxDriver運行。設置marionette: false爲@FCin suggested in his comment將告訴selenium-webdriver使用傳統的FirefoxDriver,但以後將失敗with the error you described,因爲它無法使用獨立Selenium服務器運行。爲了得到它的工作,你還需要從你的配置與directConnect: true刪除seleniumAddress和替換它像這樣:

exports.config = { 
    framework: 'jasmine', 
    directConnect: true, 
    specs: ['**/*.spec.js'], 
    multiCapabilities: [ 
     { 
      'browserName': 'chrome', 
      'loggingPrefs': { 
       'driver': 'WARNING', 
       'server': 'WARNING', 
       'browser': 'SEVERE' 
      } 
     }, 
     { 
      'browserName': 'firefox' 
     } 
    ] 
}; 

不幸的是,錯誤的量角器V5.1.0引入,打破與傳統的融合FirefoxDriver。如果你想在Firefox v45.0.1上運行,你需要將它降級到v5.0.0

相關問題