.getTitle() Suggest edits
Returns the title of the current page. Uses title protocol command.
Usage
.getTitle(callback)
Parameters
Name | Type | description |
---|---|---|
callback |
function | Callback function which is called with the result value. |
Returns
Type | description |
---|---|
string | The page title. |
Example
this.demoTest = function (browser) {
browser.getTitle(function(title) {
this.assert.equal(typeof title, 'string');
this.assert.equal(title, 'Nightwatch.js');
});
};