Class LocatorFilterOptions
- Namespace
- Microsoft.Playwright
- Assembly
- Microsoft.Playwright.dll
public class LocatorFilterOptions
- Inheritance
-
LocatorFilterOptions
- Inherited Members
Constructors
LocatorFilterOptions()
public LocatorFilterOptions()
LocatorFilterOptions(LocatorFilterOptions)
public LocatorFilterOptions(LocatorFilterOptions clone)
Parameters
clone
LocatorFilterOptions
Properties
Has
Narrows down the results of the method to those which contain elements matching
this relative locator. For example, article
that has text=Playwright
matches <article><div>Playwright</div></article>
.
Inner locator **must be relative** to the outer locator and is queried starting
with the outer locator match, not the document root. For example, you can find content
that has div
in <article><content><div>Playwright</div></content></article>
.
However, looking for content
that has article div
will fail, because
the inner locator must be relative and should not use any elements outside the content
.
Note that outer and inner locators must belong to the same frame. Inner locator must not contain IFrameLocators.
[JsonPropertyName("has")]
public ILocator? Has { get; set; }
Property Value
HasNot
Matches elements that do not contain an element that matches an inner locator. Inner
locator is queried against the outer one. For example, article
that does
not have div
matches <article><span>Playwright</span></article>
.
Note that outer and inner locators must belong to the same frame. Inner locator must not contain IFrameLocators.
[JsonPropertyName("hasNot")]
public ILocator? HasNot { get; set; }
Property Value
HasNotText
Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When passed a string, matching is case-insensitive and searches for a substring.
[JsonPropertyName("hasNotText")]
public string? HasNotText { get; set; }
Property Value
HasNotTextRegex
Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When passed a string, matching is case-insensitive and searches for a substring.
[JsonPropertyName("hasNotTextRegex")]
public Regex? HasNotTextRegex { get; set; }
Property Value
HasNotTextString
Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When passed a string, matching is case-insensitive and searches for a substring.
[JsonPropertyName("hasNotTextString")]
public string? HasNotTextString { get; set; }
Property Value
HasText
Matches elements containing specified text somewhere inside, possibly in a child
or a descendant element. When passed a string, matching is case-insensitive
and searches for a substring. For example, "Playwright"
matches <article><div>Playwright</div></article>
.
[JsonPropertyName("hasText")]
public string? HasText { get; set; }
Property Value
HasTextRegex
Matches elements containing specified text somewhere inside, possibly in a child
or a descendant element. When passed a string, matching is case-insensitive
and searches for a substring. For example, "Playwright"
matches <article><div>Playwright</div></article>
.
[JsonPropertyName("hasTextRegex")]
public Regex? HasTextRegex { get; set; }
Property Value
HasTextString
Matches elements containing specified text somewhere inside, possibly in a child
or a descendant element. When passed a string, matching is case-insensitive
and searches for a substring. For example, "Playwright"
matches <article><div>Playwright</div></article>
.
[JsonPropertyName("hasTextString")]
public string? HasTextString { get; set; }