[英]Web API .Net Core Azure Active Directory Authentication
[英]Remove authentication required popup on Azure Active directory with .net core
不幸的是,Nightwatch和基礎Selenium都不支持與此彈出窗口的交互,但是您可以做的是通過URL傳遞用戶名和密碼:
client
.url('https://username:password@example.com')
更新:
如果您打開的第一個URL不需要身份驗證(看起來就是這種情況),則上述解決方案將無法使用。
您可以做的是,在運行實際測試之前通過訪問任何需要身份驗證的URL來對瀏覽器進行預身份驗證,因此將為此瀏覽器會話中的每個下一個請求添加身份驗證標頭。 您不妨before
連接測試套件before
使用:
module.exports = {
before: function(client, done) {
client.url('https://username:password@someurl.com/auth').perform(function() {
done();
});
},
...
};
另一種方法是創建已登錄的自定義瀏覽器配置文件。
關於如何傳遞自定義firefox配置文件的有用討論: https : //github.com/nightwatchjs/nightwatch/issues/1543
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.