ページ上の要素を検索します。検出された要素は、特別なウェブ要素オブジェクト(便利なメソッドが追加されています)として返されます。
引数は、要素セレクターです。文字列、または('selector'と'locateStrategy'プロパティを持つ)オブジェクトとして指定します。
別の要素を起点として要素を検索できます。

使用方法

                    browser.element.findAll(syntax)
                

export default {
  async demoTest(browser: NightwatchAPI): Promise<void> {
    const buttonsElement = browser.element.findAll('button.submit-form');

    // Get an array of found elements.
    const buttons = await buttonsElement;

    // Use an object to customise locating behaviour.
    const sections = browser.element
      .findAll({ selector: 'section', locateStrategy: 'css selector' });
  }
}

パラメータ

名前 説明
selector セレクター

戻り値

説明
Array.<ScopeWebElement>