2016-08-23 22 views
1

基本身份驗證我創建nightwatch.json文件像下面(用戶名和access_key屬性):Nightwatch:與access_key不工作

"test_settings": { 
     "default": { 
      "launch_url": "http://localhost", 
      "selenium_port": 4444, 
      "selenium_host": "localhost", 
      "silent": true, 
      "cli_args": { 
       "webdriver.firefox.profile": "testprofile" 
      }, 
      "screenshots": { 
       "enabled": false, 
       "path": "screenshots/" 
      }, 
      "desiredCapabilities": { 
       "browserName": "firefox", 
       "javascriptEnabled": true, 
       "acceptSslCerts": true 
      }, 
      "username": "examplelogin", 
      "access_key": "password" 
     } 

但基本身份驗證不工作,我得到的登錄窗口,以填補我的密碼並在運行測試後登錄。我看着小提琴手的包,沒有授權頭。任何想法我做錯了什麼?

Nightwatch v0.9.6

回答

2

來自:https://groups.google.com/d/msg/nightwatchjs/n-B4HnnzYg8/rmaipXiTsuwJ

在回答我自己的職位之前 - 請不要混淆用戶名和 access_key瓦爾爲 '基本身份驗證' 的。它們是基於硒的 認證器,可以選擇用於對照 雲解決方案進行認證。基本身份驗證的最佳解決方案是很好的舊URL方式。 嘗試:```browser.url('https://'+ userName +':'+ password +'@'+ yourUrl)