Package org.openqa.selenium.devtools
Class DevTools
java.lang.Object
org.openqa.selenium.devtools.DevTools
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<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.<X> void
addListener
(Event<X> event, Consumer<X> handler) Register a handler to the given event.void
void
close()
void
void
createSession
(String windowHandle) Create CDP session on given window/tab (aka target).void
void
createSessionIfThereIsNotOne
(String windowHandle) void
<X> X
-
Constructor Details
-
DevTools
-
-
Method Details
-
getDomains
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
disconnectSession
public void disconnectSession() -
send
-
addListener
Register a handler to the given event.- Type Parameters:
X
- type of the data generated by the event- Parameters:
event
- the event to listen tohandler
- the handler to register
-
addListener
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 tohandler
- the handler to register
-
clearListeners
public void clearListeners() -
createSessionIfThereIsNotOne
public void createSessionIfThereIsNotOne() -
createSessionIfThereIsNotOne
-
createSession
public void createSession() -
createSession
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
-