Class Frame.LocatorOptions

  • Enclosing interface:
    Frame

    public static class Frame.LocatorOptions
    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
      LocatorOptions()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Frame.LocatorOptions setHas​(Locator has)
      Matches elements containing an element that matches an inner locator.
      Frame.LocatorOptions setHasNot​(Locator hasNot)
      Matches elements that do not contain an element that matches an inner locator.
      Frame.LocatorOptions setHasNotText​(java.lang.String hasNotText)
      Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.
      Frame.LocatorOptions setHasNotText​(java.util.regex.Pattern hasNotText)
      Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.
      Frame.LocatorOptions setHasText​(java.lang.String hasText)
      Matches elements containing specified text somewhere inside, possibly in a child or a descendant element.
      Frame.LocatorOptions 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

      • LocatorOptions

        public LocatorOptions()
    • Method Detail

      • setHas

        public Frame.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 Frame.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 Frame.LocatorOptions 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 Frame.LocatorOptions 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 Frame.LocatorOptions 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 Frame.LocatorOptions 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>.