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

使い方

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

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

    // Search for the exact occurrence.
    const images = browser.element.findAllByAltText(
      'A group of people sitting in front of a computer.',
      { exact: true }
    );
  }
}

パラメータ

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

戻り値

説明
Array.<ScopedWebElement>