指定されたテキストを含むページ上の要素を検索します。
要素は、別の要素を開始点として使用して検索できます。
デフォルトでは、指定されたテキストは部分文字列として扱われるため、'foo''foobar'にも一致します。
正確な比較が必要な場合は、2番目のパラメーターとして{ exact: true }を指定します。

使用方法

                    browser.element.findByText(text, [options])
                

export default {
  demoTest(browser: NightwatchAPI): void {
    // Search by the substring matching.
    const inputs = browser.element.findByText('group of people');

    // Search for the exact occurrence.
    const images = browser.element.findByText(
      'The nostalgic office',
      { exact: true }
    );
  }
}

パラメーター

名前 説明
text string
options
オプション
[object Object]

戻り値

説明
ScopedWebElement