Class DevTools

java.lang.Object
org.openqa.selenium.devtools.DevTools
All Implemented Interfaces:
Closeable, AutoCloseable

public class DevTools extends Object implements Closeable
  • Constructor Details

  • Method Details

    • getDomains

      public Domains getDomains()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • disconnectSession

      public void disconnectSession()
    • send

      public <X> X send(Command<X> command)
    • addListener

      public <X> void addListener(Event<X> event, Consumer<X> handler)
      Register a handler to the given event.
      Type Parameters:
      X - type of the data generated by the event
      Parameters:
      event - the event to listen to
      handler - the handler to register
    • addListener

      public <X> void addListener(Event<X> event, BiConsumer<Long,X> handler)
      Register a handler to the given event, this handler will receive a sequence number to determinate the order of the data generated by the event. The sequence number might have gaps when other events are raised in between.
      Type Parameters:
      X - type of the data generated by the event
      Parameters:
      event - the event to listen to
      handler - the handler to register
    • clearListeners

      public void clearListeners()
    • createSessionIfThereIsNotOne

      public void createSessionIfThereIsNotOne()
    • createSessionIfThereIsNotOne

      public void createSessionIfThereIsNotOne(String windowHandle)
    • createSession

      public void createSession()
    • createSession

      public void createSession(String windowHandle)
      Create CDP session on given window/tab (aka target). If windowHandle is null, then the first "page" type will be selected. Pass the windowHandle if you have multiple windows/tabs opened to connect to the expected window/tab.
      Parameters:
      windowHandle - result of WebDriver.getWindowHandle(), optional.
    • getCdpSession

      public SessionID getCdpSession()