Determines if an element is currently active/focused in the DOM.

For more info on working with DOM elements in Nightwatch, refer to the Finding & interacting with DOM Elements guide page.
For more info on the new browser.element.find() syntax, refer to the new Element API Overview page.

Usage

                    browser.element.find(selector).isActive()
                

Example

describe('isActive Demo', function() {
  it('test isActive', function(browser) {
    browser.element.find('#search')
      .isActive()
      .assert.equals(true);
  });

  it('test async isActive', async function(browser) {
    const result = await browser.element.find('#search').isActive();
    browser.assert.equal(result, true);
  });
});

Returns

Type description
ScopedValue<boolean>

W3C WebDriver spec