Automate the input of basic auth credentials whenever they arise.
This feature is currently implemented on top of Selenium 4’s CDP(Chrome DevTools Protocol) support, and so only works on those browser that support that protocol

Usage

.registerBasicAuth(username, password, [callback])

Example

Or run locally with:
git clone https://github.com/nightwatchjs/nightwatch-examples.git
cd nightwatch-examples
npm install
npx nightwatch tests/api/registerBasicAuth.js

Parameters

Name Type description
username string
password string
callback
Optional
function

Optional callback function to be called when the command finishes.