Class DOM


  • public class DOM
    extends java.lang.Object

    This class was built using the Chrome Remote Dev-Tools A.P.I., which is specified by two JSON-RPC Files. These files were obtained from the Chrome Dev Tools Protocol Git Hub Page, which has a "Tip of Tree" (the latest) API-Specification Page Here: JSON-RPC Protocol Specification.

    These files were converted into this Java-Browser (CDP) Library. The intention is to have them function in a similar fasion to the Node.js Tool known as 'Puppeteer', Microsoft's 'Playwright' and of course the Main-Stay 'Selenium.' The Java-HTML JAR Library merely implements the Java Types & Commands defined by Google's DevTools Protocol.

    🧠 View the Google CDP API:

    This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an id. This id can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client. Note that iframe owner elements will return corresponding document elements as their child nodes.

    The top-level description and explanation for this class (this comment, at the top this Java-Doc Page) is repeated, verbatim, across all of the domain classes which comprise Google's CDP API.

    This class is intended to be used with a Browser Instance

    These methods have been tested, to some degree, using Google Chrome. In order to use this class you must start a web-browser instance and make a connection to the browser using a Remote Debugging Port. Google-Corporation is the developer of this API, but any browser which accepts a Remote Debug Port Connection over Web-Sockets.

    Google-Chrome was used during the development process of the classes in this particular package. Lately, it has been asserted Microsoft has switched to using the Chrome Browser-Engine for its Microsoft Edge Internal Code-Base. Therefore, there may some functionality available when running the methods in this class with Microsoft-Edge.

    Check whether the your Web-Browser will allow itself to be driven by the Web-Socket RDP-Port 9223. See the examples available in package Torello.Browser to undertand how to build a PageConn and BrowserConn Web-Socket Connection, and how to build a WebSocketSender instance in order to execute the methods in this class.


    Web-Socket & JSON API:   
    Every one of the methods that reside in this class are designed to do nothing more than:

    1. Accept Parameters from the User, and "Marshall Them" into a Valid JSON-Request
    2. Transmit the Marshalled Request-JSON to a Headless Web-Browser over a Web-Socket Connection
    3. Receive BOTH that Command-Results AND any Browser Event-Firings from the Web-Socket
    4. Parse JSON Method-Results and Browser-Event Firings, and Subsequently Convert them to Standard Java-Types
    5. Report these Method-Results and Browser-Events to the User via a User-Registered, Event-Listener (Events) or a Promise Object (Command Responses / Results)

    Unlike the bulk of the Java HTML JAR Library, there is very little native Java-Code, and very little testing that may be done on any of the classes & methods in this package. The code inside these classes does nothing more than marshall-and-unmarshall Java-Types into Json-Requests (and vice-versa). The Java-Script & Browser modules inside of a Google-Chrome instance are, theoretically, handling these requests, and returning their results (or events) over the Web-Socket Connection.

    It has been asserted (by Google Chrome Developers) that some of these methods are only "partially working" or "experimental".


    Asking Chat-GPT for Help:   
    The LLM otherwise known as "Chat-GPT" does, indeed, have an expert level of knowledge about the "Remote DevTools Protocol". The API that the Chrome DevTools Protocl (CDP) exports is extremely well understood by the LLM, and generally I have found that Chat-GPT understands (by 2 or 3 orders of magnitude) better what my Auto-Generated JSON-Wrappers can do in controlling a Web-Browser than I could ever possibly hope to understand.

    Though not available today, there will soon be an automatically downloadable Token-Stream (AI Embeddings) BUTTON available on my Java-Doc Pages that should hopefully make it extremely easy to post my code-base, RAG Style, to Chat-GPT and other LLM's when 'interogating' them. Presently, because my "Get Token Stream Button" does not exist yet on any of my pages, what you can do is copy-and-paste any Method-Signature from any one of these pages and then ask Chat-GPT to explain what that Browser or Java-Script Function is actually doing. It is very likely to give you some pretty neat answers.

    I have found that every single one of the Domains, Types & Events which are offered by the CDP Protocol (though not documented very well by Google), are perfectly understood by the A.I. LLM - literally to the point where it does know (much better than I ever could) what my own code base actually does!

    Try it out, it's a lot of fun. Note that this package and these classes were originally developed solely to be able to execute the Java-Script that a browser executes when visiting a Web-Site. Complete HTML-Page Content can be scraped (using the HTML Data-Scraping Tools in Java-HTML) off of Web-Sites that have dynamic / Java-Script Generated Content.


    Conspicuous Boxed-Types Usage:
    You may notice that there are many methods that have parameters which accept, for instance, an Integer, instead of a primitive int. Just to remind the readiner, in Java Programs a Boxed Type is a standard Java-Primitive which has been converted into an Object-Reference. The use of Boxed-Types in this code base is an easy-and-fast-way to allow for the concept of "Optional Parameters" or "Optional Field Value."

    Whenever you see a method that accepts an Integer, the reason for this Parameter-Type choice is actually to allow a user to pass 'null' to it. This is a simple way to ELIDE passing any value at all to parameters which Google-Chrome would otherwise assert are "Optional." Whenever you pass 'null' to a Boxed-Types in this class, the Json-Processor will simply eliminate that Object-Property from the command altogether; and the browser will simply not receive any value for that parameter when that command is invoked.

    The Java Language Specification does not have an easy or well defined means of accepting optional method parameters; so Boxed-Types and 'null' are utilized here. Note that 'null' may be passed to any Command Method-Parameter that is listed as Optional on the Java-Doc Page description for that parameter.



    Stateless Class:
    This class neither contains any program-state, nor can it be instantiated. The @StaticFunctional Annotation may also be called 'The Spaghetti Report'. Static-Functional classes are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's @Stateless Annotation.

    • 1 Constructor(s), 1 declared private, zero-argument constructor
    • 55 Method(s), 55 declared static
    • 11 Field(s), 11 declared static, 11 declared final


    • Field Summary

       
      Enumerated Strings: Like Java 'enum' Types, but Converted to Read-Only String-Lists
      Modifier and Type Field Description
      static ReadOnlyList<String> CompatibilityMode
      Document compatibility mode.
      static ReadOnlyList<String> LogicalAxes
      ContainerSelector logical axes
      static ReadOnlyList<String> PhysicalAxes
      ContainerSelector physical axes
      static ReadOnlyList<String> PseudoType
      Pseudo element type.
      static ReadOnlyList<String> ScrollOrientation
      Physical scroll orientation
      static ReadOnlyList<String> ShadowRootType
      Shadow root type.
       
      Eliminated Types: Removed CDP Types which Have Been Re-Mapped to Basic Java String Constants
      Modifier and Type Field Description
      static String BackendNodeId
      Unique DOM node identifier used to reference a node that may not have been pushed to the front-end.
      static String NodeId
      Unique DOM node identifier.
      static String Quad
      An array of quad vertices, x immediately followed by y for each point, points clock-wise.
       
      Marker Events: Events without any Fields or Properties
      Modifier and Type Field Description
      static String documentUpdated
      Fired when Document has been totally updated.
      static String topLayerElementsUpdated
      Called when top layer elements are changed.
    • Method Summary

       
      DOM Domain Commands
      Script Returns Modifier and Type Method
      String[] static Script<> collectClassNamesFromSubtree​(int nodeId)
      Collects class names for the node with given id and all of it's child nodes.
      Integer static Script<> copyTo​(int nodeId, int targetNodeId, Integer insertBeforeNodeId)
      Creates a deep copy of the specified node and places it into the target container before the given anchor.
      DOM.Node static Script<> describeNode​(Integer nodeId, Integer backendNodeId, String objectId, Integer depth, Boolean pierce)
      Describes node given its id, does not require domain to be enabled.
      Void static Script<> disable()
      Disables DOM agent for the given page.
      Void static Script<> discardSearchResults​(String searchId)
      Discards search results from the session with the given id.
      Void static Script<> enable​(String includeWhitespace)
      Enables DOM agent for the given page.
      Void static Script<> focus​(Integer nodeId, Integer backendNodeId, String objectId)
      Focuses the given element.
      int[] static Script<> forceShowPopover​(int nodeId, boolean enable)
      When enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.
      Integer static Script<> getAnchorElement​(int nodeId, String anchorSpecifier)
      Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.
      String[] static Script<> getAttributes​(int nodeId)
      Returns attributes for the specified node.
      DOM.BoxModel static Script<> getBoxModel​(Integer nodeId, Integer backendNodeId, String objectId)
      Returns boxes for the given node.
      Integer static Script<> getContainerForNode​(int nodeId, String containerName, String physicalAxes, String logicalAxes, Boolean queriesScrollState, Boolean queriesAnchored)
      Returns the query container of the given node based on container query conditions: containerName, physical and logical axes, and whether it queries scroll-state or anchored elements.
      Number[] static Script<> getContentQuads​(Integer nodeId, Integer backendNodeId, String objectId)
      Returns quads that describe node position on the page.
      DOM.DetachedElementInfo[] static Script<> getDetachedDomNodes()
      Returns list of detached nodes
      DOM.Node static Script<> getDocument​(Integer depth, Boolean pierce)
      Returns the root DOM node (and optionally the subtree) to the caller.
      Integer static Script<> getElementByRelation​(int nodeId, String relation)
      Returns the NodeId of the matched element according to certain relations.
      String static Script<> getFileInfo​(String objectId)
      Returns file information for the given File wrapper.
      DOM.Node[] static Script<> getFlattenedDocument​(Integer depth, Boolean pierce)
      Returns the root DOM node (and optionally the subtree) to the caller.
      DOM.getFrameOwner$$RET static Script<> getFrameOwner​(String frameId)
      Returns iframe node that owns iframe with the given domain.
      DOM.getNodeForLocation$$RET static Script<> getNodeForLocation​(int x, int y, Boolean includeUserAgentShadowDOM, Boolean ignorePointerEventsNone)
      Returns node id at given location.
      int[] static Script<> getNodesForSubtreeByStyle​(int nodeId, DOM.CSSComputedStyleProperty[] computedStyles, Boolean pierce)
      Finds nodes with a given computed style in a subtree.
      RunTime.StackTrace static Script<> getNodeStackTraces​(int nodeId)
      Gets stack traces associated with a Node.
      String static Script<> getOuterHTML​(Integer nodeId, Integer backendNodeId, String objectId, Boolean includeShadowDOM)
      Returns node's HTML markup.
      int[] static Script<> getQueryingDescendantsForContainer​(int nodeId)
      Returns the descendants of a container query container that have container queries against this container.
      Integer static Script<> getRelayoutBoundary​(int nodeId)
      Returns the id of the nearest ancestor that is a relayout boundary.
      int[] static Script<> getSearchResults​(String searchId, int fromIndex, int toIndex)
      Returns search results from given fromIndex to given toIndex from the search with the given identifier.
      int[] static Script<> getTopLayerElements()
      Returns NodeIds of current top layer elements.
      Void static Script<> hideHighlight()
      Hides any highlight.
      Void static Script<> highlightNode()
      Highlights DOM node.
      Void static Script<> highlightRect()
      Highlights given rectangle.
      Void static Script<> markUndoableState()
      Marks last undoable state.
      Integer static Script<> moveTo​(int nodeId, int targetNodeId, Integer insertBeforeNodeId)
      Moves node into the new container, places it before the given anchor.
      DOM.performSearch$$RET static Script<> performSearch​(String query, Boolean includeUserAgentShadowDOM)
      Searches for a given string in the DOM tree.
      Integer static Script<> pushNodeByPathToFrontend​(String path)
      Requests that the node is sent to the caller given its path.
      int[] static Script<> pushNodesByBackendIdsToFrontend​(int[] backendNodeIds)
      Requests that a batch of nodes is sent to the caller given their backend node ids.
      Integer static Script<> querySelector​(int nodeId, String selector)
      Executes querySelector on a given node.
      int[] static Script<> querySelectorAll​(int nodeId, String selector)
      Executes querySelectorAll on a given node.
      Void static Script<> redo()
      Re-does the last undone action.
      Void static Script<> removeAttribute​(int nodeId, String name)
      Removes attribute with given name from an element with given id.
      Void static Script<> removeNode​(int nodeId)
      Removes node with given id.
      Void static Script<> requestChildNodes​(int nodeId, Integer depth, Boolean pierce)
      Requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth.
      Integer static Script<> requestNode​(String objectId)
      Requests that the node is sent to the caller given the JavaScript node object reference.
      RunTime.RemoteObject static Script<> resolveNode​(Integer nodeId, Integer backendNodeId, String objectGroup, Integer executionContextId)
      Resolves the JavaScript node object for a given NodeId or BackendNodeId.
      Void static Script<> scrollIntoViewIfNeeded​(Integer nodeId, Integer backendNodeId, String objectId, DOM.Rect rect)
      Scrolls the specified rect of the given node into view if not already visible.
      Void static Script<> setAttributesAsText​(int nodeId, String text, String name)
      Sets attributes on element with given id.
      Void static Script<> setAttributeValue​(int nodeId, String name, String value)
      Sets attribute for an element with given id.
      Void static Script<> setFileInputFiles​(String[] files, Integer nodeId, Integer backendNodeId, String objectId)
      Sets files for the given file input element.
      Void static Script<> setInspectedNode​(int nodeId)
      Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
      Integer static Script<> setNodeName​(int nodeId, String name)
      Sets node name for a node with given id.
      Void static Script<> setNodeStackTracesEnabled​(boolean enable)
      Sets if stack traces should be captured for Nodes.
      Void static Script<> setNodeValue​(int nodeId, String value)
      Sets node value for a node with given id.
      Void static Script<> setOuterHTML​(int nodeId, String outerHTML)
      Sets node HTML markup, returns new node id.
      Void static Script<> undo()
      Undoes the last performed action.
       
      DOM Domain CommandBuilder Methods
      Modifier and Type Method Description
      static CommandBuilder
      <DOM.Node>
      describeNode()
      Creates a buider for conveniently assigning parameters to this method.
      static CommandBuilder
      <Integer>
      getContainerForNode()
      Creates a buider for conveniently assigning parameters to this method.
      • Methods inherited from class java.lang.Object

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

      • BackendNodeId

        🡇     🗕  🗗  🗖
        public static final java.lang.String BackendNodeId
        Unique DOM node identifier used to reference a node that may not have been pushed to the front-end.

        The Type BackendNodeId has been eliminated, because it is a direct mapping to a basic Java-Type; it has no additional fields, or other distinguishing properties. Instead, this CDP defined type has been relegated to a simple String Constant, for documentation & reference purposes only.

        The code which is generated which employs this type replaces its use with the Standard Java-Type: int

        Eliminated Type
        See Also:
        Constant Field Values
      • NodeId

        🡅  🡇     🗕  🗗  🗖
        public static final java.lang.String NodeId
        Unique DOM node identifier.

        The Type NodeId has been eliminated, because it is a direct mapping to a basic Java-Type; it has no additional fields, or other distinguishing properties. Instead, this CDP defined type has been relegated to a simple String Constant, for documentation & reference purposes only.

        The code which is generated which employs this type replaces its use with the Standard Java-Type: int

        Eliminated Type
        See Also:
        Constant Field Values
      • Quad

        🡅  🡇     🗕  🗗  🗖
        public static final java.lang.String Quad
        An array of quad vertices, x immediately followed by y for each point, points clock-wise.

        The Type Quad has been eliminated, because it is a direct mapping to a basic Java-Type; it has no additional fields, or other distinguishing properties. Instead, this CDP defined type has been relegated to a simple String Constant, for documentation & reference purposes only.

        The code which is generated which employs this type replaces its use with the Standard Java-Type: Number

        Eliminated Type
        See Also:
        Constant Field Values
      • documentUpdated

        🡅  🡇     🗕  🗗  🗖
        public static final java.lang.String documentUpdated
        Fired when Document has been totally updated. Node ids are no longer valid.

        This is Marker-Event. Marker-Event's are events that do not possess any data or fields at all. When such events are fired by the browser, the Web-Socket sends nothing more than the name of the event in the packet. The Java-HTML CDP Implementation (this library) has not actually created a dedicated Java Event-Type for this Browser Event.

        This specific static field is actually just declared a String.
        documentUpdated has not been 'reified' into an actual nested / inner class of its own, at all.

        Eliminated Event Type
        See Also:
        Constant Field Values
      • topLayerElementsUpdated

        🡅  🡇     🗕  🗗  🗖
        public static final java.lang.String topLayerElementsUpdated
        Called when top layer elements are changed.
        EXPERIMENTAL

        This is Marker-Event. Marker-Event's are events that do not possess any data or fields at all. When such events are fired by the browser, the Web-Socket sends nothing more than the name of the event in the packet. The Java-HTML CDP Implementation (this library) has not actually created a dedicated Java Event-Type for this Browser Event.

        This specific static field is actually just declared a String.
        topLayerElementsUpdated has not been 'reified' into an actual nested / inner class of its own, at all.

        Eliminated Event Type
        See Also:
        Constant Field Values
    • Method Detail

      • collectClassNamesFromSubtree

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String[]> collectClassNamesFromSubtree​
                    (int nodeId)
        
        Collects class names for the node with given id and all of it's child nodes.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the node to collect class names.
        Returns:
        An instance of Script<String[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <String[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: String[] (classNames)
        Class name list.
      • copyTo

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Integer> copyTo​
                    (int nodeId,
                     int targetNodeId,
                     java.lang.Integer insertBeforeNodeId)
        
        Creates a deep copy of the specified node and places it into the target container before the given anchor.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the node to copy.
        targetNodeId - Id of the element to drop the copy into.
        insertBeforeNodeId - Drop the copy before this node (if absent, the copy becomes the last child of targetNodeId).
        OPTIONAL
        Returns:
        An instance of Script<Integer>

        This script may be executed, using Script.exec, and afterwards, a Promise <Integer> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Integer (nodeId)
        Id of the node clone.
      • describeNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<DOM.NodedescribeNode​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId,
                     java.lang.Integer depth,
                     java.lang.Boolean pierce)
        
        Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.

        👍 Because of the sheer number of input parameters to this method, there is a a CommandBuilder variant to this method which may be invoked instead.

        Please View: describeNode()
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        depth - The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
        OPTIONAL
        pierce - Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
        OPTIONAL
        Returns:
        An instance of Script<DOM.Node>

        This script may be executed, using Script.exec, and afterwards, a Promise <DOM.Node> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: DOM.Node (node)
        Node description.
      • disable

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> disable()
        Disables DOM agent for the given page.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • discardSearchResults

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> discardSearchResults​
                    (java.lang.String searchId)
        
        Discards search results from the session with the given id. getSearchResults should no longer be called for that search.
        EXPERIMENTAL
        Parameters:
        searchId - Unique search session identifier.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • enable

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> enable​
                    (java.lang.String includeWhitespace)
        
        Enables DOM agent for the given page.
        Parameters:
        includeWhitespace - Whether to include whitespaces in the children array of returned Nodes.
        Acceptable Values: ["all", "none"]
        OPTIONALEXPERIMENTAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • focus

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> focus​(java.lang.Integer nodeId,
                                                   java.lang.Integer backendNodeId,
                                                   java.lang.String objectId)
        Focuses the given element.
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • forceShowPopover

        🡅  🡇     🗕  🗗  🗖
        public static Script<int[]> forceShowPopover​(int nodeId,
                                                     boolean enable)
        When enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the popover HTMLElement
        enable - If true, opens the popover and keeps it open. If false, closes the popover if it was previously force-opened.
        Returns:
        An instance of Script<int[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <int[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: int[] (nodeIds)
        List of popovers that were closed in order to respect popover stacking order.
      • getAnchorElement

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Integer> getAnchorElement​
                    (int nodeId,
                     java.lang.String anchorSpecifier)
        
        Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the positioned element from which to find the anchor.
        anchorSpecifier - An optional anchor specifier, as defined in https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier. If not provided, it will return the implicit anchor element for the given positioned element.
        OPTIONAL
        Returns:
        An instance of Script<Integer>

        This script may be executed, using Script.exec, and afterwards, a Promise <Integer> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Integer (nodeId)
        The anchor element of the given anchor query.
      • getAttributes

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String[]> getAttributes​(int nodeId)
        Returns attributes for the specified node.
        Parameters:
        nodeId - Id of the node to retrieve attributes for.
        Returns:
        An instance of Script<String[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <String[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: String[] (attributes)
        An interleaved array of node attribute names and values.
      • getBoxModel

        🡅  🡇     🗕  🗗  🗖
        public static Script<DOM.BoxModelgetBoxModel​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId)
        
        Returns boxes for the given node.
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        Returns:
        An instance of Script<DOM.BoxModel>

        This script may be executed, using Script.exec, and afterwards, a Promise <DOM.BoxModel> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: DOM.BoxModel (model)
        Box model for the node.
      • getContainerForNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Integer> getContainerForNode​
                    (int nodeId,
                     java.lang.String containerName,
                     java.lang.String physicalAxes,
                     java.lang.String logicalAxes,
                     java.lang.Boolean queriesScrollState,
                     java.lang.Boolean queriesAnchored)
        
        Returns the query container of the given node based on container query conditions: containerName, physical and logical axes, and whether it queries scroll-state or anchored elements. If no axes are provided and queriesScrollState is false, the style container is returned, which is the direct parent or the closest element with a matching container-name.
        EXPERIMENTAL

        👍 Because of the sheer number of input parameters to this method, there is a a CommandBuilder variant to this method which may be invoked instead.

        Please View: getContainerForNode()
        Parameters:
        nodeId - -
        containerName - -
        OPTIONAL
        physicalAxes - -
        OPTIONAL
        logicalAxes - -
        OPTIONAL
        queriesScrollState - -
        OPTIONAL
        queriesAnchored - -
        OPTIONAL
        Returns:
        An instance of Script<Integer>

        This script may be executed, using Script.exec, and afterwards, a Promise <Integer> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Integer (nodeId)
        The container node for the given node, or null if not found.
      • getContentQuads

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Number[]> getContentQuads​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId)
        
        Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
        EXPERIMENTAL
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        Returns:
        An instance of Script<Number[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <Number[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Number[] (quads)
        Quads that describe node layout relative to viewport.
      • getDocument

        🡅  🡇     🗕  🗗  🗖
        public static Script<DOM.NodegetDocument​(java.lang.Integer depth,
                                                   java.lang.Boolean pierce)
        Returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.
        Parameters:
        depth - The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
        OPTIONAL
        pierce - Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
        OPTIONAL
        Returns:
        An instance of Script<DOM.Node>

        This script may be executed, using Script.exec, and afterwards, a Promise <DOM.Node> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: DOM.Node (root)
        Resulting node.
      • getElementByRelation

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Integer> getElementByRelation​
                    (int nodeId,
                     java.lang.String relation)
        
        Returns the NodeId of the matched element according to certain relations.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the node from which to query the relation.
        relation - Type of relation to get.
        Acceptable Values: ["CommandFor", "InterestTarget", "PopoverTarget"]
        Returns:
        An instance of Script<Integer>

        This script may be executed, using Script.exec, and afterwards, a Promise <Integer> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Integer (nodeId)
        NodeId of the element matching the queried relation.
      • getFileInfo

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String> getFileInfo​
                    (java.lang.String objectId)
        
        Returns file information for the given File wrapper.
        EXPERIMENTAL
        Parameters:
        objectId - JavaScript object id of the node wrapper.
        Returns:
        An instance of Script<String>

        This script may be executed, using Script.exec, and afterwards, a Promise <String> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: String (path)
      • getFlattenedDocument

        🡅  🡇     🗕  🗗  🗖
        public static Script<DOM.Node[]> getFlattenedDocument​
                    (java.lang.Integer depth,
                     java.lang.Boolean pierce)
        
        Returns the root DOM node (and optionally the subtree) to the caller. Deprecated, as it is not designed to work well with the rest of the DOM agent. Use DOMSnapshot.captureSnapshot instead.
        DEPRECATED
        Parameters:
        depth - The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
        OPTIONAL
        pierce - Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
        OPTIONAL
        Returns:
        An instance of Script<DOM.Node[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <DOM.Node[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: DOM.Node[] (nodes)
        Resulting node.
      • getNodeForLocation

        🡅  🡇     🗕  🗗  🗖
        public static Script<DOM.getNodeForLocation$$RETgetNodeForLocation​
                    (int x,
                     int y,
                     java.lang.Boolean includeUserAgentShadowDOM,
                     java.lang.Boolean ignorePointerEventsNone)
        
        Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
        Parameters:
        x - X coordinate.
        y - Y coordinate.
        includeUserAgentShadowDOM - False to skip to the nearest non-UA shadow root ancestor (default: false).
        OPTIONAL
        ignorePointerEventsNone - Whether to ignore pointer-events: none on elements and hit test them.
        OPTIONAL
        Returns:
        An instance of Script<DOM.getNodeForLocation$$RET>

        This script may be executed, using Script.exec, and afterwards, a Promise <DOM.getNodeForLocation$$RET> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns:DOM.getNodeForLocation$$RET A dedicated return type implies that the browser may return more than 1 datum
      • getNodesForSubtreeByStyle

        🡅  🡇     🗕  🗗  🗖
        public static Script<int[]> getNodesForSubtreeByStyle​
                    (int nodeId,
                     DOM.CSSComputedStyleProperty[] computedStyles,
                     java.lang.Boolean pierce)
        
        Finds nodes with a given computed style in a subtree.
        EXPERIMENTAL
        Parameters:
        nodeId - Node ID pointing to the root of a subtree.
        computedStyles - The style to filter nodes by (includes nodes if any of properties matches).
        pierce - Whether or not iframes and shadow roots in the same target should be traversed when returning the results (default is false).
        OPTIONAL
        Returns:
        An instance of Script<int[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <int[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: int[] (nodeIds)
        Resulting nodes.
      • getOuterHTML

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String> getOuterHTML​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId,
                     java.lang.Boolean includeShadowDOM)
        
        Returns node's HTML markup.
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        includeShadowDOM - Include all shadow roots. Equals to false if not specified.
        OPTIONALEXPERIMENTAL
        Returns:
        An instance of Script<String>

        This script may be executed, using Script.exec, and afterwards, a Promise <String> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: String (outerHTML)
        Outer HTML markup.
      • getQueryingDescendantsForContainer

        🡅  🡇     🗕  🗗  🗖
        public static Script<int[]> getQueryingDescendantsForContainer​(int nodeId)
        Returns the descendants of a container query container that have container queries against this container.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the container node to find querying descendants from.
        Returns:
        An instance of Script<int[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <int[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: int[] (nodeIds)
        Descendant nodes with container queries against the given container.
      • getRelayoutBoundary

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Integer> getRelayoutBoundary​(int nodeId)
        Returns the id of the nearest ancestor that is a relayout boundary.
        EXPERIMENTAL
        Parameters:
        nodeId - Id of the node.
        Returns:
        An instance of Script<Integer>

        This script may be executed, using Script.exec, and afterwards, a Promise <Integer> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Integer (nodeId)
        Relayout boundary node id for the given node.
      • getSearchResults

        🡅  🡇     🗕  🗗  🗖
        public static Script<int[]> getSearchResults​(java.lang.String searchId,
                                                     int fromIndex,
                                                     int toIndex)
        Returns search results from given fromIndex to given toIndex from the search with the given identifier.
        EXPERIMENTAL
        Parameters:
        searchId - Unique search session identifier.
        fromIndex - Start index of the search result to be returned.
        toIndex - End index of the search result to be returned.
        Returns:
        An instance of Script<int[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <int[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: int[] (nodeIds)
        Ids of the search result nodes.
      • getTopLayerElements

        🡅  🡇     🗕  🗗  🗖
        public static Script<int[]> getTopLayerElements()
        Returns NodeIds of current top layer elements. Top layer is rendered closest to the user within a viewport, therefore its elements always appear on top of all other content.
        EXPERIMENTAL
        Returns:
        An instance of Script<int[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <int[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: int[] (nodeIds)
        NodeIds of top layer elements
      • hideHighlight

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> hideHighlight()
        Hides any highlight.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • highlightNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> highlightNode()
        Highlights DOM node.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • highlightRect

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> highlightRect()
        Highlights given rectangle.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • markUndoableState

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> markUndoableState()
        Marks last undoable state.
        EXPERIMENTAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • moveTo

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Integer> moveTo​
                    (int nodeId,
                     int targetNodeId,
                     java.lang.Integer insertBeforeNodeId)
        
        Moves node into the new container, places it before the given anchor.
        Parameters:
        nodeId - Id of the node to move.
        targetNodeId - Id of the element to drop the moved node into.
        insertBeforeNodeId - Drop node before this one (if absent, the moved node becomes the last child of targetNodeId).
        OPTIONAL
        Returns:
        An instance of Script<Integer>

        This script may be executed, using Script.exec, and afterwards, a Promise <Integer> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Integer (nodeId)
        New id of the moved node.
      • performSearch

        🡅  🡇     🗕  🗗  🗖
        public static Script<DOM.performSearch$$RETperformSearch​
                    (java.lang.String query,
                     java.lang.Boolean includeUserAgentShadowDOM)
        
        Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.
        EXPERIMENTAL
        Parameters:
        query - Plain text or query selector or XPath search query.
        includeUserAgentShadowDOM - True to search in user agent shadow DOM.
        OPTIONAL
        Returns:
        An instance of Script<DOM.performSearch$$RET>

        This script may be executed, using Script.exec, and afterwards, a Promise <DOM.performSearch$$RET> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns:DOM.performSearch$$RET A dedicated return type implies that the browser may return more than 1 datum
      • pushNodeByPathToFrontend

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Integer> pushNodeByPathToFrontend​
                    (java.lang.String path)
        
        Requests that the node is sent to the caller given its path. // FIXME, use XPath
        EXPERIMENTAL
        Parameters:
        path - Path to node in the proprietary format.
        Returns:
        An instance of Script<Integer>

        This script may be executed, using Script.exec, and afterwards, a Promise <Integer> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Integer (nodeId)
        Id of the node for given path.
      • pushNodesByBackendIdsToFrontend

        🡅  🡇     🗕  🗗  🗖
        public static Script<int[]> pushNodesByBackendIdsToFrontend​
                    (int[] backendNodeIds)
        
        Requests that a batch of nodes is sent to the caller given their backend node ids.
        EXPERIMENTAL
        Parameters:
        backendNodeIds - The array of backend node ids.
        Returns:
        An instance of Script<int[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <int[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: int[] (nodeIds)
        The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.
      • querySelector

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Integer> querySelector​
                    (int nodeId,
                     java.lang.String selector)
        
        Executes querySelector on a given node.
        Parameters:
        nodeId - Id of the node to query upon.
        selector - Selector string.
        Returns:
        An instance of Script<Integer>

        This script may be executed, using Script.exec, and afterwards, a Promise <Integer> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Integer (nodeId)
        Query selector result.
      • querySelectorAll

        🡅  🡇     🗕  🗗  🗖
        public static Script<int[]> querySelectorAll​(int nodeId,
                                                     java.lang.String selector)
        Executes querySelectorAll on a given node.
        Parameters:
        nodeId - Id of the node to query upon.
        selector - Selector string.
        Returns:
        An instance of Script<int[]>

        This script may be executed, using Script.exec, and afterwards, a Promise <int[]> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: int[] (nodeIds)
        Query selector result.
      • redo

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> redo()
        Re-does the last undone action.
        EXPERIMENTAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • removeAttribute

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> removeAttribute​(int nodeId,
                                                             java.lang.String name)
        Removes attribute with given name from an element with given id.
        Parameters:
        nodeId - Id of the element to remove attribute from.
        name - Name of the attribute to remove.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • removeNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> removeNode​(int nodeId)
        Removes node with given id.
        Parameters:
        nodeId - Id of the node to remove.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • requestChildNodes

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> requestChildNodes​
                    (int nodeId,
                     java.lang.Integer depth,
                     java.lang.Boolean pierce)
        
        Requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth.
        Parameters:
        nodeId - Id of the node to get children for.
        depth - The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
        OPTIONAL
        pierce - Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • requestNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Integer> requestNode​
                    (java.lang.String objectId)
        
        Requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of setChildNodes notifications.
        Parameters:
        objectId - JavaScript object id to convert into node.
        Returns:
        An instance of Script<Integer>

        This script may be executed, using Script.exec, and afterwards, a Promise <Integer> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Integer (nodeId)
        Node id for given object.
      • resolveNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<RunTime.RemoteObjectresolveNode​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectGroup,
                     java.lang.Integer executionContextId)
        
        Resolves the JavaScript node object for a given NodeId or BackendNodeId.
        Parameters:
        nodeId - Id of the node to resolve.
        OPTIONAL
        backendNodeId - Backend identifier of the node to resolve.
        OPTIONAL
        objectGroup - Symbolic group name that can be used to release multiple objects.
        OPTIONAL
        executionContextId - Execution context in which to resolve the node.
        OPTIONAL
        Returns:
        An instance of Script<RunTime.RemoteObject>

        This script may be executed, using Script.exec, and afterwards, a Promise <RunTime.RemoteObject> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: RunTime.RemoteObject (object)
        JavaScript object wrapper for given node.
      • scrollIntoViewIfNeeded

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> scrollIntoViewIfNeeded​
                    (java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId,
                     DOM.Rect rect)
        
        Scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.
        Parameters:
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        rect - The rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • setAttributeValue

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> setAttributeValue​
                    (int nodeId,
                     java.lang.String name,
                     java.lang.String value)
        
        Sets attribute for an element with given id.
        Parameters:
        nodeId - Id of the element to set attribute for.
        name - Attribute name.
        value - Attribute value.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • setAttributesAsText

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> setAttributesAsText​
                    (int nodeId,
                     java.lang.String text,
                     java.lang.String name)
        
        Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.
        Parameters:
        nodeId - Id of the element to set attributes for.
        text - Text with a number of attributes. Will parse this text using HTML parser.
        name - Attribute name to replace with new attributes derived from text in case text parsed successfully.
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • setFileInputFiles

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> setFileInputFiles​
                    (java.lang.String[] files,
                     java.lang.Integer nodeId,
                     java.lang.Integer backendNodeId,
                     java.lang.String objectId)
        
        Sets files for the given file input element.
        Parameters:
        files - Array of file paths to set.
        nodeId - Identifier of the node.
        OPTIONAL
        backendNodeId - Identifier of the backend node.
        OPTIONAL
        objectId - JavaScript object id of the node wrapper.
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • setInspectedNode

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> setInspectedNode​(int nodeId)
        Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
        EXPERIMENTAL
        Parameters:
        nodeId - DOM node id to be accessible by means of $x command line API.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • setNodeName

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Integer> setNodeName​(int nodeId,
                                                            java.lang.String name)
        Sets node name for a node with given id.
        Parameters:
        nodeId - Id of the node to set name for.
        name - New node's name.
        Returns:
        An instance of Script<Integer>

        This script may be executed, using Script.exec, and afterwards, a Promise <Integer> will be returned

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may be retrieved.

        This Browser Function's Promise returns: Integer (nodeId)
        New node's id.
      • setNodeStackTracesEnabled

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> setNodeStackTracesEnabled​
                    (boolean enable)
        
        Sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces. Default is disabled.
        EXPERIMENTAL
        Parameters:
        enable - Enable or disable.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • setNodeValue

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> setNodeValue​(int nodeId,
                                                          java.lang.String value)
        Sets node value for a node with given id.
        Parameters:
        nodeId - Id of the node to set value for.
        value - New node's value.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • setOuterHTML

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> setOuterHTML​
                    (int nodeId,
                     java.lang.String outerHTML)
        
        Sets node HTML markup, returns new node id.
        Parameters:
        nodeId - Id of the node to set markup for.
        outerHTML - Outer HTML markup to set.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • undo

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> undo()
        Undoes the last performed action.
        EXPERIMENTAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.