Returns the element ID

Usage

                    browser.element(selector).getId()
                

Example

export default {
  demoTest(browser: NightwatchAPI): void {
    const elementId = browser.element('#main').getId();
    console.log('element id:', elementId)
  },

  async demoTestAsync(browser: NightwatchAPI): Promise<void> {
    const elementId = await browser.element('#main').getId();
    console.log('element id:', elementId);
  },
}

Returns

Type description
ScopedValue<string>