Returns the title of the current page. Uses title protocol command.

Usage

.getTitle(callback)

Example

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

Parameters

Name Type description
callback function

Callback function which is called with the result value.

Returns

Type description
string The page title.

See also