Package 

Class DOMExtensionsKt

    • Method Summary

      Modifier and Type Method Description
      final <ERROR CLASS> )>getDocumentRoot(<ERROR CLASS> $self) Retrieves the root Node of the current document.
      final <ERROR CLASS> )>getDocumentRootNodeId(<ERROR CLASS> $self) Retrieves the ID of the root node of the current document.
      final <ERROR CLASS> ,String)>findNodeBySelector(<ERROR CLASS> $self, String selector) Retrieves the ID of the node corresponding to the given selector, or null if not found.
      final <ERROR CLASS> ,String,Duration)>awaitNodeBySelector(<ERROR CLASS> $self, String selector, Duration pollingPeriod) Retrieves the ID of the node corresponding to the given selector, and retries until there is a match using the given pollingPeriod.
      final <ERROR CLASS> ,String)>getNodeBySelector(<ERROR CLASS> $self, String selector) Retrieves the ID of the node corresponding to the given selector, or throw an exception if not found.
      final Unit ,String)>focusNodeBySelector(<ERROR CLASS> $self, String selector) Moves the focus to the node corresponding to the given selector, or null if not found.
      final DOMAttributes ,String)>getAttributes(<ERROR CLASS> $self, String nodeSelector) Gets the attributes of the node corresponding to the given nodeSelector, or null if the selector didn't match any node.
      final DOMAttributes ,)>getAttributes(<ERROR CLASS> $self, <ERROR CLASS> nodeId) Gets the attributes of the node corresponding to the given nodeId.
      final String ,String,String)>getAttributeValue(<ERROR CLASS> $self, String nodeSelector, String attributeName) Gets the value of the attribute attributeName of the node corresponding to the given nodeSelector, or null if the selector didn't match any node or if the attribute was not present on the node.
      final String ,,String)>getAttributeValue(<ERROR CLASS> $self, <ERROR CLASS> nodeId, String attributeName) Gets the value of the attribute attributeName of the node corresponding to the given nodeId, or null if the attribute was not present on the node.
      final Unit ,String,String,String)>setAttributeValue(<ERROR CLASS> $self, String nodeSelector, String name, String value) Sets the attribute of the given name to the given value on the node corresponding to the given nodeSelector.
      final Unit ,,String,String)>setAttributeValue(<ERROR CLASS> $self, <ERROR CLASS> nodeId, String name, String value) Sets the attribute of the given name to the given value on the node corresponding to the given nodeId.
      final <ERROR CLASS> ,String)>getBoxModel(<ERROR CLASS> $self, String selector) Returns boxes for the node corresponding to the given selector, or null if the selector didn't match any node.
      final <ERROR CLASS> ,)>getBoxModel(<ERROR CLASS> $self, <ERROR CLASS> nodeId) Returns boxes for the node corresponding to the given nodeId.
      • Methods inherited from class java.lang.Object

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

      • getDocumentRoot

         final <ERROR CLASS> )>getDocumentRoot(<ERROR CLASS> $self)

        Retrieves the root Node of the current document.

      • getDocumentRootNodeId

         final <ERROR CLASS> )>getDocumentRootNodeId(<ERROR CLASS> $self)

        Retrieves the ID of the root node of the current document.

      • findNodeBySelector

         final <ERROR CLASS> ,String)>findNodeBySelector(<ERROR CLASS> $self, String selector)

        Retrieves the ID of the node corresponding to the given selector, or null if not found.

        Note that the returned NodeId cannot really be used to retrieve actual node information, and this is apparently by design of the DOM domain. It can be used to perform other CDP commands that require a NodeId, though.

      • awaitNodeBySelector

         final <ERROR CLASS> ,String,Duration)>awaitNodeBySelector(<ERROR CLASS> $self, String selector, Duration pollingPeriod)

        Retrieves the ID of the node corresponding to the given selector, and retries until there is a match using the given pollingPeriod.

        This method may suspend forever if the selector never matches any node. The caller is responsible for using withTimeout or similar cancellation mechanisms around calls to this method if handling this case is necessary.

        Note that the returned NodeId cannot really be used to retrieve actual node information, and this is apparently by design of the DOM domain. It can be used to perform other CDP commands that require a NodeId, though.

      • getNodeBySelector

         final <ERROR CLASS> ,String)>getNodeBySelector(<ERROR CLASS> $self, String selector)

        Retrieves the ID of the node corresponding to the given selector, or throw an exception if not found.

        Note that the returned NodeId cannot really be used to retrieve actual node information, and this is apparently by design of the DOM domain. It can be used to perform other CDP commands that require a NodeId, though.

      • getAttributes

         final DOMAttributes ,String)>getAttributes(<ERROR CLASS> $self, String nodeSelector)

        Gets the attributes of the node corresponding to the given nodeSelector, or null if the selector didn't match any node.

      • getAttributes

         final DOMAttributes ,)>getAttributes(<ERROR CLASS> $self, <ERROR CLASS> nodeId)

        Gets the attributes of the node corresponding to the given nodeId.

      • getAttributeValue

         final String ,String,String)>getAttributeValue(<ERROR CLASS> $self, String nodeSelector, String attributeName)

        Gets the value of the attribute attributeName of the node corresponding to the given nodeSelector, or null if the selector didn't match any node or if the attribute was not present on the node.

      • getAttributeValue

         final String ,,String)>getAttributeValue(<ERROR CLASS> $self, <ERROR CLASS> nodeId, String attributeName)

        Gets the value of the attribute attributeName of the node corresponding to the given nodeId, or null if the attribute was not present on the node.

      • setAttributeValue

         final Unit ,String,String,String)>setAttributeValue(<ERROR CLASS> $self, String nodeSelector, String name, String value)

        Sets the attribute of the given name to the given value on the node corresponding to the given nodeSelector. Throws an exception if the selector didn't match any node.

      • getBoxModel

         final <ERROR CLASS> ,String)>getBoxModel(<ERROR CLASS> $self, String selector)

        Returns boxes for the node corresponding to the given selector, or null if the selector didn't match any node.

      • getBoxModel

         final <ERROR CLASS> ,)>getBoxModel(<ERROR CLASS> $self, <ERROR CLASS> nodeId)

        Returns boxes for the node corresponding to the given nodeId.

        Official doc