Class FrameLocator.LocatorOptions

java.lang.Object
com.microsoft.playwright.FrameLocator.LocatorOptions
Enclosing interface:
FrameLocator

public static class FrameLocator.LocatorOptions extends Object
  • Field Details

    • has

      public Locator has
      Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one. For example, 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 FrameLocators.

    • hasNot

      public Locator 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 FrameLocators.

    • hasNotText

      public Object 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.
    • hasText

      public Object 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>.
  • Constructor Details

    • LocatorOptions

      public LocatorOptions()
  • Method Details

    • setHas

      public FrameLocator.LocatorOptions setHas(Locator has)
      Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one. For example, 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 FrameLocators.

    • setHasNot

      public FrameLocator.LocatorOptions setHasNot(Locator 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 FrameLocators.

    • setHasNotText

      public FrameLocator.LocatorOptions setHasNotText(String 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.
    • setHasNotText

      public FrameLocator.LocatorOptions setHasNotText(Pattern 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.
    • setHasText

      public FrameLocator.LocatorOptions setHasText(String 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>.
    • setHasText

      public FrameLocator.LocatorOptions setHasText(Pattern 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>.