Class FrameImpl

    • Constructor Detail

      • FrameImpl

        FrameImpl​(ChannelOwner parent,
                  java.lang.String type,
                  java.lang.String guid,
                  com.google.gson.JsonObject initializer)
    • Method Detail

      • loadStateFromProtocol

        private static WaitUntilState loadStateFromProtocol​(java.lang.String value)
      • querySelector

        public ElementHandle querySelector​(java.lang.String selector,
                                           Frame.QuerySelectorOptions options)
        Description copied from interface: Frame
        Returns the ElementHandle pointing to the frame element.

        NOTE: The use of ElementHandle is discouraged, use Locator objects and web-first assertions instead.

        The method finds an element matching the specified selector within the frame. If no elements match the selector, returns null.

        Specified by:
        querySelector in interface Frame
        Parameters:
        selector - A selector to query for.
      • querySelectorAll

        public java.util.List<ElementHandle> querySelectorAll​(java.lang.String selector)
        Description copied from interface: Frame
        Returns the ElementHandles pointing to the frame elements.

        NOTE: The use of ElementHandle is discouraged, use Locator objects instead.

        The method finds all elements matching the specified selector within the frame. If no elements match the selector, returns empty array.

        Specified by:
        querySelectorAll in interface Frame
        Parameters:
        selector - A selector to query for.
      • selectOption

        public java.util.List<java.lang.String> selectOption​(java.lang.String selector,
                                                             java.lang.String value,
                                                             Frame.SelectOptionOptions options)
        Description copied from interface: Frame
        This method waits for an element matching selector, waits for actionability checks, waits until all specified options are present in the <select> element and selects these options.

        If the target element is not a <select> element, this method throws an error. However, if the element is inside the <label> element that has an associated control, the control will be used instead.

        Returns the array of option values that have been successfully selected.

        Triggers a change and input event once all the provided options have been selected.

        **Usage**

        
         // Single selection matching the value or label
         frame.selectOption("select#colors", "blue");
         // single selection matching both the value and the label
         frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
         // multiple selection
         frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
         
        Specified by:
        selectOption in interface Frame
        Parameters:
        selector - A selector to query for.
        value - Options to select. If the <select> has the multiple attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are matching both values and labels. Option is considered matching if all specified properties match.
      • selectOption

        public java.util.List<java.lang.String> selectOption​(java.lang.String selector,
                                                             ElementHandle value,
                                                             Frame.SelectOptionOptions options)
        Description copied from interface: Frame
        This method waits for an element matching selector, waits for actionability checks, waits until all specified options are present in the <select> element and selects these options.

        If the target element is not a <select> element, this method throws an error. However, if the element is inside the <label> element that has an associated control, the control will be used instead.

        Returns the array of option values that have been successfully selected.

        Triggers a change and input event once all the provided options have been selected.

        **Usage**

        
         // Single selection matching the value or label
         frame.selectOption("select#colors", "blue");
         // single selection matching both the value and the label
         frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
         // multiple selection
         frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
         
        Specified by:
        selectOption in interface Frame
        Parameters:
        selector - A selector to query for.
        value - Options to select. If the <select> has the multiple attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are matching both values and labels. Option is considered matching if all specified properties match.
      • selectOption

        public java.util.List<java.lang.String> selectOption​(java.lang.String selector,
                                                             java.lang.String[] values,
                                                             Frame.SelectOptionOptions options)
        Description copied from interface: Frame
        This method waits for an element matching selector, waits for actionability checks, waits until all specified options are present in the <select> element and selects these options.

        If the target element is not a <select> element, this method throws an error. However, if the element is inside the <label> element that has an associated control, the control will be used instead.

        Returns the array of option values that have been successfully selected.

        Triggers a change and input event once all the provided options have been selected.

        **Usage**

        
         // Single selection matching the value or label
         frame.selectOption("select#colors", "blue");
         // single selection matching both the value and the label
         frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
         // multiple selection
         frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
         
        Specified by:
        selectOption in interface Frame
        Parameters:
        selector - A selector to query for.
        values - Options to select. If the <select> has the multiple attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are matching both values and labels. Option is considered matching if all specified properties match.
      • selectOption

        public java.util.List<java.lang.String> selectOption​(java.lang.String selector,
                                                             SelectOption value,
                                                             Frame.SelectOptionOptions options)
        Description copied from interface: Frame
        This method waits for an element matching selector, waits for actionability checks, waits until all specified options are present in the <select> element and selects these options.

        If the target element is not a <select> element, this method throws an error. However, if the element is inside the <label> element that has an associated control, the control will be used instead.

        Returns the array of option values that have been successfully selected.

        Triggers a change and input event once all the provided options have been selected.

        **Usage**

        
         // Single selection matching the value or label
         frame.selectOption("select#colors", "blue");
         // single selection matching both the value and the label
         frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
         // multiple selection
         frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
         
        Specified by:
        selectOption in interface Frame
        Parameters:
        selector - A selector to query for.
        value - Options to select. If the <select> has the multiple attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are matching both values and labels. Option is considered matching if all specified properties match.
      • querySelectorAllImpl

        java.util.List<ElementHandle> querySelectorAllImpl​(java.lang.String selector)
      • evalOnSelector

        public java.lang.Object evalOnSelector​(java.lang.String selector,
                                               java.lang.String pageFunction,
                                               java.lang.Object arg,
                                               Frame.EvalOnSelectorOptions options)
        Description copied from interface: Frame
        Returns the return value of expression.

        The method finds an element matching the specified selector within the frame and passes it as a first argument to expression. If no elements match the selector, the method throws an error.

        If expression returns a Promise, then Frame.evalOnSelector() would wait for the promise to resolve and return its value.

        **Usage**

        
         String searchValue = (String) frame.evalOnSelector("#search", "el => el.value");
         String preloadHref = (String) frame.evalOnSelector("link[rel=preload]", "el => el.href");
         String html = (String) frame.evalOnSelector(".main-container", "(e, suffix) => e.outerHTML + suffix", "hello");
         
        Specified by:
        evalOnSelector in interface Frame
        Parameters:
        selector - A selector to query for.
        pageFunction - JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked.
        arg - Optional argument to pass to expression.
      • evalOnSelectorImpl

        java.lang.Object evalOnSelectorImpl​(java.lang.String selector,
                                            java.lang.String pageFunction,
                                            java.lang.Object arg,
                                            Frame.EvalOnSelectorOptions options)
      • evalOnSelectorAll

        public java.lang.Object evalOnSelectorAll​(java.lang.String selector,
                                                  java.lang.String pageFunction,
                                                  java.lang.Object arg)
        Description copied from interface: Frame
        Returns the return value of expression.

        The method finds all elements matching the specified selector within the frame and passes an array of matched elements as a first argument to expression.

        If expression returns a Promise, then Frame.evalOnSelectorAll() would wait for the promise to resolve and return its value.

        **Usage**

        
         boolean divsCounts = (boolean) page.evalOnSelectorAll("div", "(divs, min) => divs.length >= min", 10);
         
        Specified by:
        evalOnSelectorAll in interface Frame
        Parameters:
        selector - A selector to query for.
        pageFunction - JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked.
        arg - Optional argument to pass to expression.
      • evalOnSelectorAllImpl

        java.lang.Object evalOnSelectorAllImpl​(java.lang.String selector,
                                               java.lang.String pageFunction,
                                               java.lang.Object arg)
      • addScriptTag

        public ElementHandle addScriptTag​(Frame.AddScriptTagOptions options)
        Description copied from interface: Frame
        Returns the added tag when the script's onload fires or when the script content was injected into frame.

        Adds a <script> tag into the page with the desired url or content.

        Specified by:
        addScriptTag in interface Frame
      • addStyleTag

        public ElementHandle addStyleTag​(Frame.AddStyleTagOptions options)
        Description copied from interface: Frame
        Returns the added tag when the stylesheet's onload fires or when the CSS content was injected into frame.

        Adds a <link rel="stylesheet"> tag into the page with the desired url or a <style type="text/css"> tag with the content.

        Specified by:
        addStyleTag in interface Frame
      • check

        public void check​(java.lang.String selector,
                          Frame.CheckOptions options)
        Description copied from interface: Frame
        This method checks an element matching selector by performing the following steps:
        1. Find an element matching selector. If there is none, wait until a matching element is attached to the DOM.
        2. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already checked, this method returns immediately.
        3. Wait for actionability checks on the matched element, unless force option is set. If the element is detached during the checks, the whole action is retried.
        4. Scroll the element into view if needed.
        5. Use Page.mouse() to click in the center of the element.
        6. Wait for initiated navigations to either succeed or fail, unless noWaitAfter option is set.
        7. Ensure that the element is now checked. If not, this method throws.

        When all steps combined have not finished during the specified timeout, this method throws a TimeoutError. Passing zero timeout disables this.

        Specified by:
        check in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • childFrames

        public java.util.List<Frame> childFrames()
        Specified by:
        childFrames in interface Frame
      • click

        public void click​(java.lang.String selector,
                          Frame.ClickOptions options)
        Description copied from interface: Frame
        This method clicks an element matching selector by performing the following steps:
        1. Find an element matching selector. If there is none, wait until a matching element is attached to the DOM.
        2. Wait for actionability checks on the matched element, unless force option is set. If the element is detached during the checks, the whole action is retried.
        3. Scroll the element into view if needed.
        4. Use Page.mouse() to click in the center of the element, or the specified position.
        5. Wait for initiated navigations to either succeed or fail, unless noWaitAfter option is set.

        When all steps combined have not finished during the specified timeout, this method throws a TimeoutError. Passing zero timeout disables this.

        Specified by:
        click in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • content

        public java.lang.String content()
        Description copied from interface: Frame
        Gets the full HTML contents of the frame, including the doctype.
        Specified by:
        content in interface Frame
      • contentImpl

        java.lang.String contentImpl()
      • dblclick

        public void dblclick​(java.lang.String selector,
                             Frame.DblclickOptions options)
        Description copied from interface: Frame
        This method double clicks an element matching selector by performing the following steps:
        1. Find an element matching selector. If there is none, wait until a matching element is attached to the DOM.
        2. Wait for actionability checks on the matched element, unless force option is set. If the element is detached during the checks, the whole action is retried.
        3. Scroll the element into view if needed.
        4. Use Page.mouse() to double click in the center of the element, or the specified position.
        5. Wait for initiated navigations to either succeed or fail, unless noWaitAfter option is set. Note that if the first click of the dblclick() triggers a navigation event, this method will throw.

        When all steps combined have not finished during the specified timeout, this method throws a TimeoutError. Passing zero timeout disables this.

        NOTE: frame.dblclick() dispatches two click events and a single dblclick event.

        Specified by:
        dblclick in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • dispatchEvent

        public void dispatchEvent​(java.lang.String selector,
                                  java.lang.String type,
                                  java.lang.Object eventInit,
                                  Frame.DispatchEventOptions options)
        Description copied from interface: Frame
        The snippet below dispatches the click event on the element. Regardless of the visibility state of the element, click is dispatched. This is equivalent to calling element.click().

        **Usage**

        
         frame.dispatchEvent("button#submit", "click");
         

        Under the hood, it creates an instance of an event based on the given type, initializes it with eventInit properties and dispatches it on the element. Events are composed, cancelable and bubble by default.

        Since eventInit is event-specific, please refer to the events documentation for the lists of initial properties:

        You can also specify JSHandle as the property value if you want live objects to be passed into the event:

        
         // Note you can only create DataTransfer in Chromium and Firefox
         JSHandle dataTransfer = frame.evaluateHandle("() => new DataTransfer()");
         Map<String, Object> arg = new HashMap<>();
         arg.put("dataTransfer", dataTransfer);
         frame.dispatchEvent("#source", "dragstart", arg);
         
        Specified by:
        dispatchEvent in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
        type - DOM event type: "click", "dragstart", etc.
        eventInit - Optional event-specific initialization properties.
      • dispatchEventImpl

        void dispatchEventImpl​(java.lang.String selector,
                               java.lang.String type,
                               java.lang.Object eventInit,
                               Frame.DispatchEventOptions options)
      • evaluate

        public java.lang.Object evaluate​(java.lang.String expression,
                                         java.lang.Object arg)
        Description copied from interface: Frame
        Returns the return value of expression.

        If the function passed to the Frame.evaluate() returns a Promise, then Frame.evaluate() would wait for the promise to resolve and return its value.

        If the function passed to the Frame.evaluate() returns a non-[Serializable] value, then Frame.evaluate() returns undefined. Playwright also supports transferring some additional values that are not serializable by JSON: -0, NaN, Infinity, -Infinity.

        **Usage**

        
         Object result = frame.evaluate("([x, y]) => {\n" +
           "  return Promise.resolve(x * y);\n" +
           "}", Arrays.asList(7, 8));
         System.out.println(result); // prints "56"
         

        A string can also be passed in instead of a function.

        
         System.out.println(frame.evaluate("1 + 2")); // prints "3"
         

        ElementHandle instances can be passed as an argument to the Frame.evaluate():

        
         ElementHandle bodyHandle = frame.evaluate("document.body");
         String html = (String) frame.evaluate("([body, suffix]) => body.innerHTML + suffix", Arrays.asList(bodyHandle, "hello"));
         bodyHandle.dispose();
         
        Specified by:
        evaluate in interface Frame
        Parameters:
        expression - JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked.
        arg - Optional argument to pass to expression.
      • evaluateImpl

        java.lang.Object evaluateImpl​(java.lang.String expression,
                                      java.lang.Object arg)
      • evaluateHandle

        public JSHandle evaluateHandle​(java.lang.String pageFunction,
                                       java.lang.Object arg)
        Description copied from interface: Frame
        Returns the return value of expression as a JSHandle.

        The only difference between Frame.evaluate() and Frame.evaluateHandle() is that Frame.evaluateHandle() returns JSHandle.

        If the function, passed to the Frame.evaluateHandle(), returns a Promise, then Frame.evaluateHandle() would wait for the promise to resolve and return its value.

        **Usage**

        
         // Handle for the window object.
         JSHandle aWindowHandle = frame.evaluateHandle("() => Promise.resolve(window)");
         

        A string can also be passed in instead of a function.

        
         JSHandle aHandle = frame.evaluateHandle("document"); // Handle for the "document".
         

        JSHandle instances can be passed as an argument to the Frame.evaluateHandle():

        
         JSHandle aHandle = frame.evaluateHandle("() => document.body");
         JSHandle resultHandle = frame.evaluateHandle("([body, suffix]) => body.innerHTML + suffix", Arrays.asList(aHandle, "hello"));
         System.out.println(resultHandle.jsonValue());
         resultHandle.dispose();
         
        Specified by:
        evaluateHandle in interface Frame
        Parameters:
        pageFunction - JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked.
        arg - Optional argument to pass to expression.
      • evaluateHandleImpl

        JSHandle evaluateHandleImpl​(java.lang.String pageFunction,
                                    java.lang.Object arg)
      • fill

        public void fill​(java.lang.String selector,
                         java.lang.String value,
                         Frame.FillOptions options)
        Description copied from interface: Frame
        This method waits for an element matching selector, waits for actionability checks, focuses the element, fills it and triggers an input event after filling. Note that you can pass an empty string to clear the input field.

        If the target element is not an <input>, <textarea> or [contenteditable] element, this method throws an error. However, if the element is inside the <label> element that has an associated control, the control will be filled instead.

        To send fine-grained keyboard events, use Locator.pressSequentially().

        Specified by:
        fill in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
        value - Value to fill for the <input>, <textarea> or [contenteditable] element.
      • fillImpl

        void fillImpl​(java.lang.String selector,
                      java.lang.String value,
                      Frame.FillOptions options)
      • focus

        public void focus​(java.lang.String selector,
                          Frame.FocusOptions options)
        Description copied from interface: Frame
        This method fetches an element with selector and focuses it. If there's no element matching selector, the method waits until a matching element appears in the DOM.
        Specified by:
        focus in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • frameElement

        public ElementHandle frameElement()
        Description copied from interface: Frame
        Returns the frame or iframe element handle which corresponds to this frame.

        This is an inverse of ElementHandle.contentFrame(). Note that returned handle actually belongs to the parent frame.

        This method throws an error if the frame has been detached before frameElement() returns.

        **Usage**

        
         ElementHandle frameElement = frame.frameElement();
         Frame contentFrame = frameElement.contentFrame();
         System.out.println(frame == contentFrame);  // -> true
         
        Specified by:
        frameElement in interface Frame
      • frameLocator

        public FrameLocator frameLocator​(java.lang.String selector)
        Description copied from interface: Frame
        When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements in that iframe.

        **Usage**

        Following snippet locates element with text "Submit" in the iframe with id my-frame, like <iframe id="my-frame">:

        
         Locator locator = frame.frameLocator("#my-iframe").getByText("Submit");
         locator.click();
         
        Specified by:
        frameLocator in interface Frame
        Parameters:
        selector - A selector to use when resolving DOM element.
      • getAttribute

        public java.lang.String getAttribute​(java.lang.String selector,
                                             java.lang.String name,
                                             Frame.GetAttributeOptions options)
        Description copied from interface: Frame
        Returns element attribute value.
        Specified by:
        getAttribute in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
        name - Attribute name to get the value for.
      • getByAltText

        public Locator getByAltText​(java.lang.String text,
                                    Frame.GetByAltTextOptions options)
        Description copied from interface: Frame
        Allows locating elements by their alt text.

        **Usage**

        For example, this method will find the image by alt text "Playwright logo":

        
         page.getByAltText("Playwright logo").click();
         
        Specified by:
        getByAltText in interface Frame
        Parameters:
        text - Text to locate the element for.
      • getByAltText

        public Locator getByAltText​(java.util.regex.Pattern text,
                                    Frame.GetByAltTextOptions options)
        Description copied from interface: Frame
        Allows locating elements by their alt text.

        **Usage**

        For example, this method will find the image by alt text "Playwright logo":

        
         page.getByAltText("Playwright logo").click();
         
        Specified by:
        getByAltText in interface Frame
        Parameters:
        text - Text to locate the element for.
      • getByLabel

        public Locator getByLabel​(java.lang.String text,
                                  Frame.GetByLabelOptions options)
        Description copied from interface: Frame
        Allows locating input elements by the text of the associated <label> or aria-labelledby element, or by the aria-label attribute.

        **Usage**

        For example, this method will find inputs by label "Username" and "Password" in the following DOM:

        
         page.getByLabel("Username").fill("john");
         page.getByLabel("Password").fill("secret");
         
        Specified by:
        getByLabel in interface Frame
        Parameters:
        text - Text to locate the element for.
      • getByLabel

        public Locator getByLabel​(java.util.regex.Pattern text,
                                  Frame.GetByLabelOptions options)
        Description copied from interface: Frame
        Allows locating input elements by the text of the associated <label> or aria-labelledby element, or by the aria-label attribute.

        **Usage**

        For example, this method will find inputs by label "Username" and "Password" in the following DOM:

        
         page.getByLabel("Username").fill("john");
         page.getByLabel("Password").fill("secret");
         
        Specified by:
        getByLabel in interface Frame
        Parameters:
        text - Text to locate the element for.
      • getByPlaceholder

        public Locator getByPlaceholder​(java.lang.String text,
                                        Frame.GetByPlaceholderOptions options)
        Description copied from interface: Frame
        Allows locating input elements by the placeholder text.

        **Usage**

        For example, consider the following DOM structure.

        You can fill the input after locating it by the placeholder text:

        
         page.getByPlaceholder("name@example.com").fill("playwright@microsoft.com");
         
        Specified by:
        getByPlaceholder in interface Frame
        Parameters:
        text - Text to locate the element for.
      • getByPlaceholder

        public Locator getByPlaceholder​(java.util.regex.Pattern text,
                                        Frame.GetByPlaceholderOptions options)
        Description copied from interface: Frame
        Allows locating input elements by the placeholder text.

        **Usage**

        For example, consider the following DOM structure.

        You can fill the input after locating it by the placeholder text:

        
         page.getByPlaceholder("name@example.com").fill("playwright@microsoft.com");
         
        Specified by:
        getByPlaceholder in interface Frame
        Parameters:
        text - Text to locate the element for.
      • getByRole

        public Locator getByRole​(AriaRole role,
                                 Frame.GetByRoleOptions options)
        Description copied from interface: Frame
        Allows locating elements by their ARIA role, ARIA attributes and accessible name.

        **Usage**

        Consider the following DOM structure.

        You can locate each element by it's implicit role:

        
         assertThat(page
             .getByRole(AriaRole.HEADING,
                        new Page.GetByRoleOptions().setName("Sign up")))
             .isVisible();
        
         page.getByRole(AriaRole.CHECKBOX,
                        new Page.GetByRoleOptions().setName("Subscribe"))
             .check();
        
         page.getByRole(AriaRole.BUTTON,
                        new Page.GetByRoleOptions().setName(
                            Pattern.compile("submit", Pattern.CASE_INSENSITIVE)))
             .click();
         

        **Details**

        Role selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.

        Many html elements have an implicitly defined role that is recognized by the role selector. You can find all the supported roles here. ARIA guidelines **do not recommend** duplicating implicit roles and attributes by setting role and/or aria-* attributes to default values.

        Specified by:
        getByRole in interface Frame
        Parameters:
        role - Required aria role.
      • getByTestId

        public Locator getByTestId​(java.lang.String testId)
        Description copied from interface: Frame
        Locate element by the test id.

        **Usage**

        Consider the following DOM structure.

        You can locate the element by it's test id:

        
         page.getByTestId("directions").click();
         

        **Details**

        By default, the data-testid attribute is used as a test id. Use Selectors.setTestIdAttribute() to configure a different test id attribute if necessary.

        Specified by:
        getByTestId in interface Frame
        Parameters:
        testId - Id to locate the element by.
      • getByTestId

        public Locator getByTestId​(java.util.regex.Pattern testId)
        Description copied from interface: Frame
        Locate element by the test id.

        **Usage**

        Consider the following DOM structure.

        You can locate the element by it's test id:

        
         page.getByTestId("directions").click();
         

        **Details**

        By default, the data-testid attribute is used as a test id. Use Selectors.setTestIdAttribute() to configure a different test id attribute if necessary.

        Specified by:
        getByTestId in interface Frame
        Parameters:
        testId - Id to locate the element by.
      • getByText

        public Locator getByText​(java.lang.String text,
                                 Frame.GetByTextOptions options)
        Description copied from interface: Frame
        Allows locating elements that contain given text.

        See also Locator.filter() that allows to match by another criteria, like an accessible role, and then filter by the text content.

        **Usage**

        Consider the following DOM structure:

        You can locate by text substring, exact string, or a regular expression:

        
         // Matches <span>
         page.getByText("world")
        
         // Matches first <div>
         page.getByText("Hello world")
        
         // Matches second <div>
         page.getByText("Hello", new Page.GetByTextOptions().setExact(true))
        
         // Matches both <div>s
         page.getByText(Pattern.compile("Hello"))
        
         // Matches second <div>
         page.getByText(Pattern.compile("^hello$", Pattern.CASE_INSENSITIVE))
         

        **Details**

        Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into one, turns line breaks into spaces and ignores leading and trailing whitespace.

        Input elements of the type button and submit are matched by their value instead of the text content. For example, locating by text "Log in" matches <input type=button value="Log in">.

        Specified by:
        getByText in interface Frame
        Parameters:
        text - Text to locate the element for.
      • getByText

        public Locator getByText​(java.util.regex.Pattern text,
                                 Frame.GetByTextOptions options)
        Description copied from interface: Frame
        Allows locating elements that contain given text.

        See also Locator.filter() that allows to match by another criteria, like an accessible role, and then filter by the text content.

        **Usage**

        Consider the following DOM structure:

        You can locate by text substring, exact string, or a regular expression:

        
         // Matches <span>
         page.getByText("world")
        
         // Matches first <div>
         page.getByText("Hello world")
        
         // Matches second <div>
         page.getByText("Hello", new Page.GetByTextOptions().setExact(true))
        
         // Matches both <div>s
         page.getByText(Pattern.compile("Hello"))
        
         // Matches second <div>
         page.getByText(Pattern.compile("^hello$", Pattern.CASE_INSENSITIVE))
         

        **Details**

        Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into one, turns line breaks into spaces and ignores leading and trailing whitespace.

        Input elements of the type button and submit are matched by their value instead of the text content. For example, locating by text "Log in" matches <input type=button value="Log in">.

        Specified by:
        getByText in interface Frame
        Parameters:
        text - Text to locate the element for.
      • getByTitle

        public Locator getByTitle​(java.lang.String text,
                                  Frame.GetByTitleOptions options)
        Description copied from interface: Frame
        Allows locating elements by their title attribute.

        **Usage**

        Consider the following DOM structure.

        You can check the issues count after locating it by the title text:

        
         assertThat(page.getByTitle("Issues count")).hasText("25 issues");
         
        Specified by:
        getByTitle in interface Frame
        Parameters:
        text - Text to locate the element for.
      • getByTitle

        public Locator getByTitle​(java.util.regex.Pattern text,
                                  Frame.GetByTitleOptions options)
        Description copied from interface: Frame
        Allows locating elements by their title attribute.

        **Usage**

        Consider the following DOM structure.

        You can check the issues count after locating it by the title text:

        
         assertThat(page.getByTitle("Issues count")).hasText("25 issues");
         
        Specified by:
        getByTitle in interface Frame
        Parameters:
        text - Text to locate the element for.
      • getAttributeImpl

        java.lang.String getAttributeImpl​(java.lang.String selector,
                                          java.lang.String name,
                                          Frame.GetAttributeOptions options)
      • navigate

        public ResponseImpl navigate​(java.lang.String url,
                                     Frame.NavigateOptions options)
        Description copied from interface: Frame
        Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.

        The method will throw an error if:

        • there's an SSL error (e.g. in case of self-signed certificates).
        • target URL is invalid.
        • the timeout is exceeded during navigation.
        • the remote server does not respond or is unreachable.
        • the main resource failed to load.

        The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling Response.status().

        NOTE: The method either throws an error or returns a main resource response. The only exceptions are navigation to about:blank or navigation to the same URL with a different hash, which would succeed and return null.

        NOTE: Headless mode doesn't support navigation to a PDF document. See the upstream issue.

        Specified by:
        navigate in interface Frame
        Parameters:
        url - URL to navigate frame to. The url should include scheme, e.g. https://.
      • hover

        public void hover​(java.lang.String selector,
                          Frame.HoverOptions options)
        Description copied from interface: Frame
        This method hovers over an element matching selector by performing the following steps:
        1. Find an element matching selector. If there is none, wait until a matching element is attached to the DOM.
        2. Wait for actionability checks on the matched element, unless force option is set. If the element is detached during the checks, the whole action is retried.
        3. Scroll the element into view if needed.
        4. Use Page.mouse() to hover over the center of the element, or the specified position.
        5. Wait for initiated navigations to either succeed or fail, unless noWaitAfter option is set.

        When all steps combined have not finished during the specified timeout, this method throws a TimeoutError. Passing zero timeout disables this.

        Specified by:
        hover in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • dragAndDrop

        public void dragAndDrop​(java.lang.String source,
                                java.lang.String target,
                                Frame.DragAndDropOptions options)
        Specified by:
        dragAndDrop in interface Frame
        Parameters:
        source - A selector to search for an element to drag. If there are multiple elements satisfying the selector, the first will be used.
        target - A selector to search for an element to drop onto. If there are multiple elements satisfying the selector, the first will be used.
      • dragAndDropImpl

        void dragAndDropImpl​(java.lang.String source,
                             java.lang.String target,
                             Frame.DragAndDropOptions options)
      • innerHTML

        public java.lang.String innerHTML​(java.lang.String selector,
                                          Frame.InnerHTMLOptions options)
        Description copied from interface: Frame
        Returns element.innerHTML.
        Specified by:
        innerHTML in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • innerHTMLImpl

        java.lang.String innerHTMLImpl​(java.lang.String selector,
                                       Frame.InnerHTMLOptions options)
      • innerText

        public java.lang.String innerText​(java.lang.String selector,
                                          Frame.InnerTextOptions options)
        Description copied from interface: Frame
        Returns element.innerText.
        Specified by:
        innerText in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • innerTextImpl

        java.lang.String innerTextImpl​(java.lang.String selector,
                                       Frame.InnerTextOptions options)
      • inputValue

        public java.lang.String inputValue​(java.lang.String selector,
                                           Frame.InputValueOptions options)
        Description copied from interface: Frame
        Returns input.value for the selected <input> or <textarea> or <select> element.

        Throws for non-input elements. However, if the element is inside the <label> element that has an associated control, returns the value of the control.

        Specified by:
        inputValue in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • isChecked

        public boolean isChecked​(java.lang.String selector,
                                 Frame.IsCheckedOptions options)
        Description copied from interface: Frame
        Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
        Specified by:
        isChecked in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • isDetached

        public boolean isDetached()
        Description copied from interface: Frame
        Returns true if the frame has been detached, or false otherwise.
        Specified by:
        isDetached in interface Frame
      • isDisabled

        public boolean isDisabled​(java.lang.String selector,
                                  Frame.IsDisabledOptions options)
        Description copied from interface: Frame
        Returns whether the element is disabled, the opposite of enabled.
        Specified by:
        isDisabled in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • isEditable

        public boolean isEditable​(java.lang.String selector,
                                  Frame.IsEditableOptions options)
        Description copied from interface: Frame
        Returns whether the element is editable.
        Specified by:
        isEditable in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • isEnabled

        public boolean isEnabled​(java.lang.String selector,
                                 Frame.IsEnabledOptions options)
        Description copied from interface: Frame
        Returns whether the element is enabled.
        Specified by:
        isEnabled in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • isHidden

        public boolean isHidden​(java.lang.String selector,
                                Frame.IsHiddenOptions options)
        Description copied from interface: Frame
        Returns whether the element is hidden, the opposite of visible. selector that does not match any elements is considered hidden.
        Specified by:
        isHidden in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • isVisible

        public boolean isVisible​(java.lang.String selector,
                                 Frame.IsVisibleOptions options)
        Description copied from interface: Frame
        Returns whether the element is visible. selector that does not match any elements is considered not visible.
        Specified by:
        isVisible in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • locator

        public Locator locator​(java.lang.String selector,
                               Frame.LocatorOptions options)
        Description copied from interface: Frame
        The method returns an element locator that can be used to perform actions on this page / frame. Locator is resolved to the element immediately before performing an action, so a series of actions on the same locator can in fact be performed on different DOM elements. That would happen if the DOM structure between those actions has changed.

        Learn more about locators.

        Learn more about locators.

        Specified by:
        locator in interface Frame
        Parameters:
        selector - A selector to use when resolving DOM element.
      • name

        public java.lang.String name()
        Description copied from interface: Frame
        Returns frame's name attribute as specified in the tag.

        If the name is empty, returns the id attribute instead.

        NOTE: This value is calculated once when the frame is created, and will not update if the attribute is changed later.

        Specified by:
        name in interface Frame
      • page

        public PageImpl page()
        Description copied from interface: Frame
        Returns the page containing this frame.
        Specified by:
        page in interface Frame
      • parentFrame

        public Frame parentFrame()
        Description copied from interface: Frame
        Parent frame, if any. Detached frames and main frames return null.
        Specified by:
        parentFrame in interface Frame
      • press

        public void press​(java.lang.String selector,
                          java.lang.String key,
                          Frame.PressOptions options)
        Description copied from interface: Frame
        key can specify the intended keyboardEvent.key value or a single character to generate the text for. A superset of the key values can be found here. Examples of the keys are:

        F1 - F12, Digit0- Digit9, KeyA- KeyZ, Backquote, Minus, Equal, Backslash, Backspace, Tab, Delete, Escape, ArrowDown, End, Enter, Home, Insert, PageDown, PageUp, ArrowRight, ArrowUp, etc.

        Following modification shortcuts are also supported: Shift, Control, Alt, Meta, ShiftLeft.

        Holding down Shift will type the text that corresponds to the key in the upper case.

        If key is a single character, it is case-sensitive, so the values a and A will generate different respective texts.

        Shortcuts such as key: "Control+o" or key: "Control+Shift+T" are supported as well. When specified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.

        Specified by:
        press in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
        key - Name of the key to press or a character to generate, such as ArrowLeft or a.
      • pressImpl

        void pressImpl​(java.lang.String selector,
                       java.lang.String key,
                       Frame.PressOptions options)
      • selectOption

        public java.util.List<java.lang.String> selectOption​(java.lang.String selector,
                                                             SelectOption[] values,
                                                             Frame.SelectOptionOptions options)
        Description copied from interface: Frame
        This method waits for an element matching selector, waits for actionability checks, waits until all specified options are present in the <select> element and selects these options.

        If the target element is not a <select> element, this method throws an error. However, if the element is inside the <label> element that has an associated control, the control will be used instead.

        Returns the array of option values that have been successfully selected.

        Triggers a change and input event once all the provided options have been selected.

        **Usage**

        
         // Single selection matching the value or label
         frame.selectOption("select#colors", "blue");
         // single selection matching both the value and the label
         frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
         // multiple selection
         frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
         
        Specified by:
        selectOption in interface Frame
        Parameters:
        selector - A selector to query for.
        values - Options to select. If the <select> has the multiple attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are matching both values and labels. Option is considered matching if all specified properties match.
      • selectOptionImpl

        java.util.List<java.lang.String> selectOptionImpl​(java.lang.String selector,
                                                          java.lang.String[] values,
                                                          Frame.SelectOptionOptions options)
      • selectOption

        public java.util.List<java.lang.String> selectOption​(java.lang.String selector,
                                                             ElementHandle[] values,
                                                             Frame.SelectOptionOptions options)
        Description copied from interface: Frame
        This method waits for an element matching selector, waits for actionability checks, waits until all specified options are present in the <select> element and selects these options.

        If the target element is not a <select> element, this method throws an error. However, if the element is inside the <label> element that has an associated control, the control will be used instead.

        Returns the array of option values that have been successfully selected.

        Triggers a change and input event once all the provided options have been selected.

        **Usage**

        
         // Single selection matching the value or label
         frame.selectOption("select#colors", "blue");
         // single selection matching both the value and the label
         frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
         // multiple selection
         frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
         
        Specified by:
        selectOption in interface Frame
        Parameters:
        selector - A selector to query for.
        values - Options to select. If the <select> has the multiple attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are matching both values and labels. Option is considered matching if all specified properties match.
      • selectOption

        private java.util.List<java.lang.String> selectOption​(com.google.gson.JsonObject params)
      • setChecked

        public void setChecked​(java.lang.String selector,
                               boolean checked,
                               Frame.SetCheckedOptions options)
        Description copied from interface: Frame
        This method checks or unchecks an element matching selector by performing the following steps:
        1. Find an element matching selector. If there is none, wait until a matching element is attached to the DOM.
        2. Ensure that matched element is a checkbox or a radio input. If not, this method throws.
        3. If the element already has the right checked state, this method returns immediately.
        4. Wait for actionability checks on the matched element, unless force option is set. If the element is detached during the checks, the whole action is retried.
        5. Scroll the element into view if needed.
        6. Use Page.mouse() to click in the center of the element.
        7. Wait for initiated navigations to either succeed or fail, unless noWaitAfter option is set.
        8. Ensure that the element is now checked or unchecked. If not, this method throws.

        When all steps combined have not finished during the specified timeout, this method throws a TimeoutError. Passing zero timeout disables this.

        Specified by:
        setChecked in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
        checked - Whether to check or uncheck the checkbox.
      • setCheckedImpl

        void setCheckedImpl​(java.lang.String selector,
                            boolean checked,
                            Frame.SetCheckedOptions options)
      • setContent

        public void setContent​(java.lang.String html,
                               Frame.SetContentOptions options)
        Description copied from interface: Frame
        This method internally calls document.write(), inheriting all its specific characteristics and behaviors.
        Specified by:
        setContent in interface Frame
        Parameters:
        html - HTML markup to assign to the page.
      • setInputFiles

        public void setInputFiles​(java.lang.String selector,
                                  java.nio.file.Path files,
                                  Frame.SetInputFilesOptions options)
        Description copied from interface: Frame
        Sets the value of the file input to these file paths or files. If some of the filePaths are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.

        This method expects selector to point to an input element. However, if the element is inside the <label> element that has an associated control, targets the control instead.

        Specified by:
        setInputFiles in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • setInputFiles

        public void setInputFiles​(java.lang.String selector,
                                  java.nio.file.Path[] files,
                                  Frame.SetInputFilesOptions options)
        Description copied from interface: Frame
        Sets the value of the file input to these file paths or files. If some of the filePaths are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.

        This method expects selector to point to an input element. However, if the element is inside the <label> element that has an associated control, targets the control instead.

        Specified by:
        setInputFiles in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • setInputFilesImpl

        void setInputFilesImpl​(java.lang.String selector,
                               java.nio.file.Path[] files,
                               Frame.SetInputFilesOptions options)
      • setInputFiles

        public void setInputFiles​(java.lang.String selector,
                                  FilePayload files,
                                  Frame.SetInputFilesOptions options)
        Description copied from interface: Frame
        Sets the value of the file input to these file paths or files. If some of the filePaths are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.

        This method expects selector to point to an input element. However, if the element is inside the <label> element that has an associated control, targets the control instead.

        Specified by:
        setInputFiles in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • setInputFiles

        public void setInputFiles​(java.lang.String selector,
                                  FilePayload[] files,
                                  Frame.SetInputFilesOptions options)
        Description copied from interface: Frame
        Sets the value of the file input to these file paths or files. If some of the filePaths are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.

        This method expects selector to point to an input element. However, if the element is inside the <label> element that has an associated control, targets the control instead.

        Specified by:
        setInputFiles in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • tap

        public void tap​(java.lang.String selector,
                        Frame.TapOptions options)
        Description copied from interface: Frame
        This method taps an element matching selector by performing the following steps:
        1. Find an element matching selector. If there is none, wait until a matching element is attached to the DOM.
        2. Wait for actionability checks on the matched element, unless force option is set. If the element is detached during the checks, the whole action is retried.
        3. Scroll the element into view if needed.
        4. Use Page.touchscreen() to tap the center of the element, or the specified position.
        5. Wait for initiated navigations to either succeed or fail, unless noWaitAfter option is set.

        When all steps combined have not finished during the specified timeout, this method throws a TimeoutError. Passing zero timeout disables this.

        NOTE: frame.tap() requires that the hasTouch option of the browser context be set to true.

        Specified by:
        tap in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • tapImpl

        void tapImpl​(java.lang.String selector,
                     Frame.TapOptions options)
      • textContent

        public java.lang.String textContent​(java.lang.String selector,
                                            Frame.TextContentOptions options)
        Description copied from interface: Frame
        Returns element.textContent.
        Specified by:
        textContent in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • title

        public java.lang.String title()
        Description copied from interface: Frame
        Returns the page title.
        Specified by:
        title in interface Frame
      • titleImpl

        java.lang.String titleImpl()
      • type

        public void type​(java.lang.String selector,
                         java.lang.String text,
                         Frame.TypeOptions options)
        Specified by:
        type in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
        text - A text to type into a focused element.
      • typeImpl

        void typeImpl​(java.lang.String selector,
                      java.lang.String text,
                      Frame.TypeOptions options)
      • uncheck

        public void uncheck​(java.lang.String selector,
                            Frame.UncheckOptions options)
        Description copied from interface: Frame
        This method checks an element matching selector by performing the following steps:
        1. Find an element matching selector. If there is none, wait until a matching element is attached to the DOM.
        2. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already unchecked, this method returns immediately.
        3. Wait for actionability checks on the matched element, unless force option is set. If the element is detached during the checks, the whole action is retried.
        4. Scroll the element into view if needed.
        5. Use Page.mouse() to click in the center of the element.
        6. Wait for initiated navigations to either succeed or fail, unless noWaitAfter option is set.
        7. Ensure that the element is now unchecked. If not, this method throws.

        When all steps combined have not finished during the specified timeout, this method throws a TimeoutError. Passing zero timeout disables this.

        Specified by:
        uncheck in interface Frame
        Parameters:
        selector - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
      • url

        public java.lang.String url()
        Description copied from interface: Frame
        Returns frame's url.
        Specified by:
        url in interface Frame
      • waitForFunction

        public JSHandle waitForFunction​(java.lang.String pageFunction,
                                        java.lang.Object arg,
                                        Frame.WaitForFunctionOptions options)
        Description copied from interface: Frame
        Returns when the expression returns a truthy value, returns that value.

        **Usage**

        The Frame.waitForFunction() can be used to observe viewport size change:

        
         import com.microsoft.playwright.*;
        
         public class Example {
           public static void main(String[] args) {
             try (Playwright playwright = Playwright.create()) {
               BrowserType firefox = playwright.firefox();
               Browser browser = firefox.launch();
               Page page = browser.newPage();
               page.setViewportSize(50, 50);
               page.mainFrame().waitForFunction("window.innerWidth < 100");
               browser.close();
             }
           }
         }
         

        To pass an argument to the predicate of frame.waitForFunction function:

        
         String selector = ".foo";
         frame.waitForFunction("selector => !!document.querySelector(selector)", selector);
         
        Specified by:
        waitForFunction in interface Frame
        Parameters:
        pageFunction - JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked.
        arg - Optional argument to pass to expression.
      • waitForLoadState

        public void waitForLoadState​(LoadState state,
                                     Frame.WaitForLoadStateOptions options)
        Description copied from interface: Frame
        Waits for the required load state to be reached.

        This returns when the frame reaches a required load state, load by default. The navigation must have been committed when this method is called. If current document has already reached the required state, resolves immediately.

        **Usage**

        
         frame.click("button"); // Click triggers navigation.
         frame.waitForLoadState(); // Waits for "load" state by default.
         
        Specified by:
        waitForLoadState in interface Frame
        Parameters:
        state - Optional load state to wait for, defaults to load. If the state has been already reached while loading current document, the method resolves immediately. Can be one of:
        • "load" - wait for the load event to be fired.
        • "domcontentloaded" - wait for the DOMContentLoaded event to be fired.
        • "networkidle" - **DISCOURAGED** wait until there are no network connections for at least 500 ms. Don't use this method for testing, rely on web assertions to assess readiness instead.
      • waitForSelector

        public ElementHandle waitForSelector​(java.lang.String selector,
                                             Frame.WaitForSelectorOptions options)
        Description copied from interface: Frame
        Returns when element specified by selector satisfies state option. Returns null if waiting for hidden or detached.

        NOTE: Playwright automatically waits for element to be ready before performing an action. Using Locator objects and web-first assertions make the code wait-for-selector-free.

        Wait for the selector to satisfy state option (either appear/disappear from dom, or become visible/hidden). If at the moment of calling the method selector already satisfies the condition, the method will return immediately. If the selector doesn't satisfy the condition for the timeout milliseconds, the function will throw.

        **Usage**

        This method works across navigations:

        
         import com.microsoft.playwright.*;
        
         public class Example {
           public static void main(String[] args) {
             try (Playwright playwright = Playwright.create()) {
               BrowserType chromium = playwright.chromium();
               Browser browser = chromium.launch();
               Page page = browser.newPage();
               for (String currentURL : Arrays.asList("https://google.com", "https://bbc.com")) {
                 page.navigate(currentURL);
                 ElementHandle element = page.mainFrame().waitForSelector("img");
                 System.out.println("Loaded image: " + element.getAttribute("src"));
               }
               browser.close();
             }
           }
         }
         
        Specified by:
        waitForSelector in interface Frame
        Parameters:
        selector - A selector to query for.
      • waitForTimeout

        public void waitForTimeout​(double timeout)
        Description copied from interface: Frame
        Waits for the given timeout in milliseconds.

        Note that frame.waitForTimeout() should only be used for debugging. Tests using the timer in production are going to be flaky. Use signals such as network events, selectors becoming visible and others instead.

        Specified by:
        waitForTimeout in interface Frame
        Parameters:
        timeout - A timeout to wait for
      • waitForTimeoutImpl

        void waitForTimeoutImpl​(double timeout)
      • waitForURL

        public void waitForURL​(java.lang.String url,
                               Frame.WaitForURLOptions options)
        Description copied from interface: Frame
        Waits for the frame to navigate to the given URL.

        **Usage**

        
         frame.click("a.delayed-navigation"); // Clicking the link will indirectly cause a navigation
         frame.waitForURL("**\/target.html");
         
        Specified by:
        waitForURL in interface Frame
        Parameters:
        url - A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string.
      • waitForURL

        public void waitForURL​(java.util.regex.Pattern url,
                               Frame.WaitForURLOptions options)
        Description copied from interface: Frame
        Waits for the frame to navigate to the given URL.

        **Usage**

        
         frame.click("a.delayed-navigation"); // Clicking the link will indirectly cause a navigation
         frame.waitForURL("**\/target.html");
         
        Specified by:
        waitForURL in interface Frame
        Parameters:
        url - A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string.
      • waitForURL

        public void waitForURL​(java.util.function.Predicate<java.lang.String> url,
                               Frame.WaitForURLOptions options)
        Description copied from interface: Frame
        Waits for the frame to navigate to the given URL.

        **Usage**

        
         frame.click("a.delayed-navigation"); // Clicking the link will indirectly cause a navigation
         frame.waitForURL("**\/target.html");
         
        Specified by:
        waitForURL in interface Frame
        Parameters:
        url - A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string.
      • queryCount

        int queryCount​(java.lang.String selector)
      • highlightImpl

        void highlightImpl​(java.lang.String selector)
      • handleEvent

        protected void handleEvent​(java.lang.String event,
                                   com.google.gson.JsonObject params)
        Overrides:
        handleEvent in class ChannelOwner