Modifier and Type | Field and Description |
---|---|
Locator |
has
Matches elements containing an element that matches an inner locator.
|
Object |
hasText
Matches elements containing specified text somewhere inside, possibly in a child or a descendant element.
|
Constructor and Description |
---|
FilterOptions() |
Modifier and Type | Method and Description |
---|---|
Locator.FilterOptions |
setHas(Locator has)
Matches elements containing an element that matches an inner locator.
|
Locator.FilterOptions |
setHasText(Pattern hasText)
Matches elements containing specified text somewhere inside, possibly in a child or a descendant element.
|
Locator.FilterOptions |
setHasText(String hasText)
Matches elements containing specified text somewhere inside, possibly in a child or a descendant element.
|
public Locator has
article
that has text=Playwright
matches <article><div>Playwright</div></article>
.
Note that outer and inner locators must belong to the same frame. Inner locator must not contain FrameLocator
s.
public Object hasText
"Playwright"
matches
<article><div>Playwright</div></article>
.public Locator.FilterOptions setHas(Locator has)
article
that has text=Playwright
matches <article><div>Playwright</div></article>
.
Note that outer and inner locators must belong to the same frame. Inner locator must not contain FrameLocator
s.
public Locator.FilterOptions setHasText(String hasText)
"Playwright"
matches
<article><div>Playwright</div></article>
.public Locator.FilterOptions setHasText(Pattern hasText)
"Playwright"
matches
<article><div>Playwright</div></article>
.Copyright © 2022. All rights reserved.