![](/img/trans.png)
[英]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.