java.lang.Object
org.openqa.selenium.devtools.v121.overlay.Overlay

@Beta public class Overlay extends Object
This domain provides various functionality related to drawing atop the inspected page.
  • Constructor Details

    • Overlay

      public Overlay()
  • Method Details

    • disable

      public static org.openqa.selenium.devtools.Command<Void> disable()
      Disables domain notifications.
    • enable

      public static org.openqa.selenium.devtools.Command<Void> enable()
      Enables domain notifications.
    • getHighlightObjectForTest

      public static org.openqa.selenium.devtools.Command<Map<String,Object>> getHighlightObjectForTest(NodeId nodeId, Optional<Boolean> includeDistance, Optional<Boolean> includeStyle, Optional<ColorFormat> colorFormat, Optional<Boolean> showAccessibilityInfo)
      For testing.
    • getGridHighlightObjectsForTest

      public static org.openqa.selenium.devtools.Command<Map<String,Object>> getGridHighlightObjectsForTest(List<NodeId> nodeIds)
      For Persistent Grid testing.
    • getSourceOrderHighlightObjectForTest

      public static org.openqa.selenium.devtools.Command<Map<String,Object>> getSourceOrderHighlightObjectForTest(NodeId nodeId)
      For Source Order Viewer testing.
    • hideHighlight

      public static org.openqa.selenium.devtools.Command<Void> hideHighlight()
      Hides any highlight.
    • highlightFrame

      @Deprecated public static org.openqa.selenium.devtools.Command<Void> highlightFrame(FrameId frameId, Optional<RGBA> contentColor, Optional<RGBA> contentOutlineColor)
      Deprecated.
      Highlights owner element of the frame with given id. Deprecated: Doesn't work reliablity and cannot be fixed due to process separatation (the owner node might be in a different process). Determine the owner node in the client and use highlightNode.
    • highlightNode

      public static org.openqa.selenium.devtools.Command<Void> highlightNode(HighlightConfig highlightConfig, Optional<NodeId> nodeId, Optional<BackendNodeId> backendNodeId, Optional<RemoteObjectId> objectId, Optional<String> selector)
      Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.
    • highlightQuad

      public static org.openqa.selenium.devtools.Command<Void> highlightQuad(Quad quad, Optional<RGBA> color, Optional<RGBA> outlineColor)
      Highlights given quad. Coordinates are absolute with respect to the main frame viewport.
    • highlightRect

      public static org.openqa.selenium.devtools.Command<Void> highlightRect(Integer x, Integer y, Integer width, Integer height, Optional<RGBA> color, Optional<RGBA> outlineColor)
      Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
    • highlightSourceOrder

      public static org.openqa.selenium.devtools.Command<Void> highlightSourceOrder(SourceOrderConfig sourceOrderConfig, Optional<NodeId> nodeId, Optional<BackendNodeId> backendNodeId, Optional<RemoteObjectId> objectId)
      Highlights the source order of the children of the DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.
    • setInspectMode

      public static org.openqa.selenium.devtools.Command<Void> setInspectMode(InspectMode mode, Optional<HighlightConfig> highlightConfig)
      Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.
    • setShowAdHighlights

      public static org.openqa.selenium.devtools.Command<Void> setShowAdHighlights(Boolean show)
      Highlights owner element of all frames detected to be ads.
    • setPausedInDebuggerMessage

      public static org.openqa.selenium.devtools.Command<Void> setPausedInDebuggerMessage(Optional<String> message)
    • setShowDebugBorders

      public static org.openqa.selenium.devtools.Command<Void> setShowDebugBorders(Boolean show)
      Requests that backend shows debug borders on layers
    • setShowFPSCounter

      public static org.openqa.selenium.devtools.Command<Void> setShowFPSCounter(Boolean show)
      Requests that backend shows the FPS counter
    • setShowGridOverlays

      public static org.openqa.selenium.devtools.Command<Void> setShowGridOverlays(List<GridNodeHighlightConfig> gridNodeHighlightConfigs)
      Highlight multiple elements with the CSS Grid overlay.
    • setShowFlexOverlays

      public static org.openqa.selenium.devtools.Command<Void> setShowFlexOverlays(List<FlexNodeHighlightConfig> flexNodeHighlightConfigs)
    • setShowScrollSnapOverlays

      public static org.openqa.selenium.devtools.Command<Void> setShowScrollSnapOverlays(List<ScrollSnapHighlightConfig> scrollSnapHighlightConfigs)
    • setShowContainerQueryOverlays

      public static org.openqa.selenium.devtools.Command<Void> setShowContainerQueryOverlays(List<ContainerQueryHighlightConfig> containerQueryHighlightConfigs)
    • setShowPaintRects

      public static org.openqa.selenium.devtools.Command<Void> setShowPaintRects(Boolean result)
      Requests that backend shows paint rectangles
    • setShowLayoutShiftRegions

      public static org.openqa.selenium.devtools.Command<Void> setShowLayoutShiftRegions(Boolean result)
      Requests that backend shows layout shift regions
    • setShowScrollBottleneckRects

      public static org.openqa.selenium.devtools.Command<Void> setShowScrollBottleneckRects(Boolean show)
      Requests that backend shows scroll bottleneck rects
    • setShowHitTestBorders

      @Deprecated public static org.openqa.selenium.devtools.Command<Void> setShowHitTestBorders(Boolean show)
      Deprecated.
      Deprecated, no longer has any effect.
    • setShowWebVitals

      public static org.openqa.selenium.devtools.Command<Void> setShowWebVitals(Boolean show)
      Request that backend shows an overlay with web vital metrics.
    • setShowViewportSizeOnResize

      public static org.openqa.selenium.devtools.Command<Void> setShowViewportSizeOnResize(Boolean show)
      Paints viewport size upon main frame resize.
    • setShowHinge

      public static org.openqa.selenium.devtools.Command<Void> setShowHinge(Optional<HingeConfig> hingeConfig)
      Add a dual screen device hinge
    • setShowIsolatedElements

      public static org.openqa.selenium.devtools.Command<Void> setShowIsolatedElements(List<IsolatedElementHighlightConfig> isolatedElementHighlightConfigs)
      Show elements in isolation mode with overlays.
    • setShowWindowControlsOverlay

      public static org.openqa.selenium.devtools.Command<Void> setShowWindowControlsOverlay(Optional<WindowControlsOverlayConfig> windowControlsOverlayConfig)
      Show Window Controls Overlay for PWA
    • inspectNodeRequested

      public static org.openqa.selenium.devtools.Event<BackendNodeId> inspectNodeRequested()
    • nodeHighlightRequested

      public static org.openqa.selenium.devtools.Event<NodeId> nodeHighlightRequested()
    • screenshotRequested

      public static org.openqa.selenium.devtools.Event<Viewport> screenshotRequested()
    • inspectModeCanceled

      public static org.openqa.selenium.devtools.Event<Void> inspectModeCanceled()