.findAllByPlaceholderText() 編集を提案
バージョン: 3.0.0 以降指定されたテキストを持つplaceholder
属性を持つページ上の要素を検索します。
要素は、開始点として別の要素を使用して検索できます。
デフォルトでは、提供されたテキストは部分文字列として扱われるため、'foo'
は'foobar'
にも一致します。
正確な比較が必要な場合は、2番目のパラメータとして{ exact: true }
を指定します。
使用法
browser.element.findAllByPlaceholderText(text, [options])
例
export default {
demoTest(browser: NightwatchAPI): void {
// Search by the substring matching.
const inputs = browser.element.findAllByPlaceholderText('group of people');
// Search for the exact occurrence.
const images = browser.element.findAllByPlaceholderText(
'Search here',
{ exact: true }
);
const images = browser.element.findAllByPlaceholderText(
'Enter the number',
{ exact: true, suppressNotFoundError: true }
);
}
}
パラメータ
名前 | 型 | 説明 |
---|---|---|
text |
string | |
options オプション |
[object Object] |
戻り値
型 | 説明 |
---|---|
Array.<ScopeWebElement> |