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