Constant
, Dom
, JavaScript
, Keyboard
, Mouse
, Navigator
, Selector
, AutoCloseable
public class Session extends Object implements AutoCloseable, Selector, Keyboard, Mouse, Navigator, JavaScript, Dom
BACKSPACE, DOM_PROPERTIES, DOWN_ARROW, EMPTY_ARGS, EMPTY_NODE_ID, ENTER, ESC, LEFT_ARROW, RIGHT_ARROW, SPECIAL_KEYS, TAB, UP_ARROW, WAIT_PERIOD, WAIT_TIMEOUT
Modifier and Type | Method | Description |
---|---|---|
void |
activate() |
Activate this browser window
|
void |
addEventListener(EventListener eventListener) |
Use
Session#getListenerManager() |
byte[] |
captureScreenshot() |
Capture page screenshot.
|
byte[] |
captureScreenshot(boolean hideScrollbar) |
Capture page screenshot.
|
byte[] |
captureScreenshot(boolean hideScrollbar,
ImageFormat format,
Integer quality,
Viewport clip,
Boolean fromSurface) |
Capture page screenshot.
|
void |
close() |
Close the this browser window
|
Session |
enableConsoleLog() |
Redirects javascript console logs to slf4j
|
Session |
enableDetailLog() |
Redirects runtime logs (network, security, storage etc..) to slf4j
|
Session |
enableNetworkLog() |
Redirects network logs to slf4j
|
boolean |
equals(Object obj) |
|
String |
getBrowserContextId() |
|
Command |
getCommand() |
|
Integer |
getExecutionContextId() |
|
String |
getFrameId() |
|
String |
getId() |
|
String |
getTargetId() |
|
Session |
getThis() |
|
int |
hashCode() |
|
boolean |
isConnected() |
|
Session |
navigate(String url) |
|
Session |
navigateAndWait(String url,
WaitUntil condition) |
|
Session |
navigateAndWait(String url,
WaitUntil condition,
int timeout) |
|
void |
onTerminate(TerminateListener terminateListener) |
|
void |
removeEventEventListener(EventListener eventListener) |
Use
Session#getListenerManager() |
String |
toString() |
|
Session |
wait(int timeout) |
Causes the current thread to wait until waiting time elapses.
|
Session |
wait(int timeout,
boolean log) |
Causes the current thread to wait until waiting time elapses.
|
Session |
waitDocumentReady() |
waits until document is ready
|
Session |
waitDocumentReady(int timeout) |
waits until document is ready
|
boolean |
waitUntil(Predicate<Session> predicate) |
|
boolean |
waitUntil(Predicate<Session> predicate,
int timeout) |
|
boolean |
waitUntil(Predicate<Session> predicate,
int timeout,
int period) |
|
boolean |
waitUntil(Predicate<Session> predicate,
int timeout,
int period,
boolean log) |
clearOptions, clearOptions, focus, focus, focus, getAttribute, getAttribute, getAttribute, getAttributes, getAttributes, getAttributes, getBoxModel, getBoxModel, getOptions, getOptions, getOuterHtml, getOuterHtml, getSelectedIndex, getSelectedIndex, getText, getText, getValue, getValue, isChecked, isChecked, isDisabled, isDisabled, selectInputText, selectInputText, setAttribute, setAttribute, setAttribute, setChecked, setChecked, setDisabled, setDisabled, setFiles, setFiles, setSelectedIndex, setSelectedIndex, setSelectedOptions, setSelectedOptions, setValue, setValue
callFunction, callFunction, callFunction, evaluate, getVariable, setVariable
sendBackspace, sendDownArrow, sendEnter, sendEsc, sendKeyCode, sendKeys, sendLeftArrow, sendRightArrow, sendTab, sendUpArrow
back, clearCache, clearCookies, forward, getContent, getLocation, getPathname, getQueryString, getTitle, isDomReady, reload, setUserAgent, stop
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getNodeId, getNodeId, getObjectId, getObjectId, getObjectId, getObjectIds, getObjectIds, getObjectIdWithContext, getProperty, getProperty, getPropertyByObjectId, getPropertyDescriptor, matches, matches, matches, releaseObject, setProperty, setProperty
public String getId()
public void close()
close
in interface AutoCloseable
public boolean isConnected()
public void activate()
public void addEventListener(EventListener eventListener)
Session#getListenerManager()
public void removeEventEventListener(EventListener eventListener)
Session#getListenerManager()
public Session waitDocumentReady()
public Session waitDocumentReady(int timeout)
timeout
- the maximum time to wait in millisecondspublic boolean waitUntil(Predicate<Session> predicate, int timeout, int period, boolean log)
public Session enableConsoleLog()
public Session enableDetailLog()
public Session enableNetworkLog()
public Session getThis()
public String getFrameId()
public byte[] captureScreenshot()
public byte[] captureScreenshot(boolean hideScrollbar)
hideScrollbar
- hides the scollbarpublic byte[] captureScreenshot(boolean hideScrollbar, ImageFormat format, Integer quality, Viewport clip, Boolean fromSurface)
hideScrollbar
- hides the scollbarformat
- Image compression format (defaults to png).quality
- Compression quality from range [0..100] (jpeg only).clip
- Capture the screenshot of a given region only.fromSurface
- Capture the screenshot from the surface, rather than the view. Defaults to true.public Session wait(int timeout)
timeout
- the maximum time to wait in millisecondsCdpException
- if the session held by another thread at the time of invocation.public Session wait(int timeout, boolean log)
timeout
- the maximum time to wait in millisecondsCdpException
- if the session held by another thread at the time of invocation.public void onTerminate(TerminateListener terminateListener)
public Command getCommand()
public String getTargetId()
public String getBrowserContextId()
public Integer getExecutionContextId()
Copyright © 2017, 2018–2018 WebFolder OÜ. All rights reserved.