Search for multiple elements on the page, starting from the document root. The located elements will be returned as web element JSON objects.
First argument to be passed is the locator strategy, which is detailed on the WebDriver docs.

The locator strategy can be one of:

  • css selector
  • link text
  • partial link text
  • tag name
  • xpath
For more info on working with DOM elements in Nightwatch, refer to the Finding & interacting with DOM Elements guide page.


.elements(using, value, [callback])


module.exports = {
 'demo Test' : function(browser) {
    browser.elements('css selector', 'ul li', function(result) {

  'es6 async demo Test': async function(browser) {
    const result = await browser.elements('css selector', 'ul li');
    console.log('result value is:', result.value);

  'page object demo Test': function (browser) {
     var nightwatch =;

     nightwatch.api.elements('@featuresList', function(result) {



Name Type description
using string

The locator strategy to use.

value string

The search target.

callback function

Callback function to be invoked with the result when the command finishes.

W3C WebDriver spec