Package org.openqa.selenium.devtools
Class DevTools
- java.lang.Object
-
- org.openqa.selenium.devtools.DevTools
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class DevTools extends java.lang.Object implements java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description DevTools(java.util.function.Function<DevTools,Domains> protocol, Connection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <X> void
addListener(Event<X> event, java.util.function.Consumer<X> handler)
void
clearListeners()
void
close()
void
createSession()
void
createSession(java.lang.String windowHandle)
Create CDP session on given window/tab (aka target).void
createSessionIfThereIsNotOne()
void
createSessionIfThereIsNotOne(java.lang.String windowHandle)
void
disconnectSession()
SessionID
getCdpSession()
Domains
getDomains()
<X> X
send(Command<X> command)
-
-
-
Constructor Detail
-
DevTools
public DevTools(java.util.function.Function<DevTools,Domains> protocol, Connection connection)
-
-
Method Detail
-
getDomains
public Domains getDomains()
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
disconnectSession
public void disconnectSession()
-
send
public <X> X send(Command<X> command)
-
addListener
public <X> void addListener(Event<X> event, java.util.function.Consumer<X> handler)
-
clearListeners
public void clearListeners()
-
createSessionIfThereIsNotOne
public void createSessionIfThereIsNotOne()
-
createSessionIfThereIsNotOne
public void createSessionIfThereIsNotOne(java.lang.String windowHandle)
-
createSession
public void createSession()
-
createSession
public void createSession(java.lang.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 ofWebDriver.getWindowHandle()
, optional.
-
getCdpSession
public SessionID getCdpSession()
-
-