I've got a selenium hub running at https://admin:[email protected]
The following configuration should set basic auth headers (I tried to figure this out from the source):
"test_settings" : {
"default" : {
"selenium_port" : 443,
"selenium_host" : "selenium.myhost.com",
"use_ssl": true,
"credentials": {
"username": "admin",
"key": "secret"
},
But it doesn't work:
Running: Demo test Google
Error processing the server response:
<html><body><h1>401 Unauthorized</h1>
You need a valid user and password to access this content.
</body></html>
Anyone?
The way I deal with this issue is by setting credentials in the launch URL. So something like
"test_settings": {
"default": {
"launch_url": "https://username:[email protected]",
...
}
}
You're configuration is wrong. It should be:
"test_settings" : {
"default" : {
"username": "admin",
"access_key": "secret"
}
},
https://github.com/nightwatchjs/nightwatch/blob/master/bin/nightwatch.json#L48
@mattpardee How do you handle this in the url if the password contains spaces? i.e "test test test". Idk why but it is not working for me when specifying in test settings.
@aamorozov does "test%20test%20test" work? not sure how otherwise
@mattpardee Yep, it worked, thank you!
Most helpful comment
You're configuration is wrong. It should be:
https://github.com/nightwatchjs/nightwatch/blob/master/bin/nightwatch.json#L48