Get the element on the page that currently has focus. The element will be returned as a Web Element JSON object.

elementActive() will automatically wait for the element to be present (until the specified timeout). If the element is not found, an error is thrown which will cause the test to fail. Starting with v1.2 you can suppress element not found errors by specifying the suppressNotFoundErrors option.

Please note that this command operates on a protocol level and accepts the Web Element ID as the parameter. To retrieve it, use either the .element() or .elements() command. Read more on Element retrieval.



Name Type description
callback function

Callback function which is called with the result value.


module.exports = {
 'demo Test' : function(browser) {
    browser.elementActive(function(result) {

W3C WebDriver spec