Class Locator.FilterOptions

  • Enclosing interface:
    Locator

    public static class Locator.FilterOptions
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      Locator has
      Matches elements containing an element that matches an inner locator.
      Locator hasNot
      Matches elements that do not contain an element that matches an inner locator.
      java.lang.Object hasNotText
      Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.
      java.lang.Object hasText
      Matches elements containing specified text somewhere inside, possibly in a child or a descendant element.
    • Constructor Summary

      Constructors 
      Constructor Description
      FilterOptions()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Locator.FilterOptions setHas​(Locator has)
      Matches elements containing an element that matches an inner locator.
      Locator.FilterOptions setHasNot​(Locator hasNot)
      Matches elements that do not contain an element that matches an inner locator.
      Locator.FilterOptions setHasNotText​(java.lang.String hasNotText)
      Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.
      Locator.FilterOptions setHasNotText​(java.util.regex.Pattern hasNotText)
      Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.
      Locator.FilterOptions setHasText​(java.lang.String hasText)
      Matches elements containing specified text somewhere inside, possibly in a child or a descendant element.
      Locator.FilterOptions setHasText​(java.util.regex.Pattern hasText)
      Matches elements containing specified text somewhere inside, possibly in a child or a descendant element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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 java.lang.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 java.lang.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 Detail

      • FilterOptions

        public FilterOptions()
    • Method Detail

      • setHas

        public Locator.FilterOptions 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 Locator.FilterOptions 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 Locator.FilterOptions setHasNotText​(java.lang.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 Locator.FilterOptions setHasNotText​(java.util.regex.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 Locator.FilterOptions setHasText​(java.lang.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 Locator.FilterOptions setHasText​(java.util.regex.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>.