Catch the JavaScript exceptions thrown in the browser.

Usage

.captureBrowserExceptions(onExceptionCallback)

Example

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

Parameters

Name Type description
onExceptionCallback function

Callback function called whenever a new exception is thrown in the browser.

Recommended content