selenium - 守夜人 : Basic auth with access_key not working

标签 selenium testing nightwatch.js end-to-end

我创建了如下所示的 nightwatch.json 文件(具有用户名和 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"
        }

但基本身份验证不起作用,我在运行测试后获得登录窗口以填写我的密码并登录。我查看了 fiddler 中的数据包,没有授权 header 存在。知道我做错了什么吗?

守夜人 v0.9.6

最佳答案

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

Replying to my own post before - please don't confuse the username and access_key vars as 'basic auth' ones. They are selenium based authenticators which can optionally be used for authenticating against cloud solutions. Best solution for basic auth is the good old URL way. Try: ``` browser.url('https://' + userName + ':' + password + '@' + yourUrl)

关于selenium - 守夜人 : Basic auth with access_key not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39096176/

相关文章:

automation - 我的 nightwatch.js 测试无法在 CentOS 的 headless Chrome 中运行

python - Selenium ( python ): Errno 101 Connection Refused on screenshot?

selenium - 为什么我可以点击类型=radio 的 h :selectOneRadio, 而不是 p :selectOneRadio with Graphene/Selenium? 之一的输入

javascript - Nightwatch.js 错误 : "Cannot read propery ' equal' of undefined

angular - 正确测试简单组件的 Observable

使用 DAO 测试对象

nightwatch.js - 如何使用带夜视仪的酱汁实验室?

python - 如何使用 selenium webdriver python 单击调用下拉菜单?

python - Selenium 独立服务器日志级别

performance - 在jmeter中计算页面渲染时间