N
- Original web browser enclosed (wrapped) by this class.public abstract class AbstractWebBrowser<N> extends Object implements WebBrowser
WebBrowser.ContentType, WebBrowser.Options
MiniBrowser.Advice
Modifier and Type | Field and Description |
---|---|
protected boolean |
locationEmpty
TODO describe
|
Constructor and Description |
---|
AbstractWebBrowser() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the browser.
|
void |
enableSilentPromptService(boolean b)
if enabled, blocks allElements javascript alerts and popups.
|
protected abstract N |
getBrowser() |
DOMElement |
getDOMElementByLocator(String xPathLocator)
It returns the DOMElement identified by the given xpath.
|
URL |
getURL()
Returns the same as
MiniBrowser.getLocationURL() but as a URL . |
DOMWindow |
getWindow()
Return the top-level dom window associated to this browser.
|
JSUtils |
js() |
void |
navigate(URI uri,
boolean waitUntilLoaded)
Navigate to the given URI.
|
void |
setPageLoadingTimeout(long time,
TimeUnit unit)
Set the timeout for page loading.
|
BrowserStats |
stats() |
File |
takeScreenshot()
Returns a file (created in the temporary file location as indicated by the browser) with a screenshot of the
current browser window.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLocationListener, addOpenNewWindowListener, addProgressListener, addStatusTextListener, addTitleListener, back, cleanCache, evaluate, executeJavaScript, forward, getContentDOMWindow, getEngine, getWindowFrame, getXPathEvaluator, isBackEnabled, isForwardEnabled, manageOptions, navigate, navigateAndStatus, refresh, removeAllCookies, removeLocationListener, removeOpenNewWindowListener, removeProgressListener, removeStatusTextListener, removeTitleListener, saveDocument, setDialogsService, setWindowPosition, setWindowSize, setZoom, shutdown, stop, switchToDefaultContent, switchToFrame
back, getActionExecutor, getAdviceProcessor, getLocationURL, navigate, navigate
protected abstract N getBrowser()
public URL getURL()
WebBrowser
MiniBrowser.getLocationURL()
but as a URL
. Returns null
if the URL is not valid.getURL
in interface MiniBrowser
getURL
in interface WebBrowser
public BrowserStats stats()
stats
in interface WebBrowser
public DOMElement getDOMElementByLocator(String xPathLocator) throws WebAPINoSuchElementException
MiniBrowser
getDOMElementByLocator
in interface MiniBrowser
WebAPINoSuchElementException
- if the element is not found, or the found node is not an element nodepublic void setPageLoadingTimeout(long time, TimeUnit unit)
WebBrowser
WebBrowser.navigate(String, boolean)
will throw exceptions.setPageLoadingTimeout
in interface WebBrowser
public File takeScreenshot()
WebBrowser
takeScreenshot
in interface WebBrowser
public JSUtils js()
js
in interface WebBrowser
public void navigate(URI uri, boolean waitUntilLoaded)
WebBrowser
navigate
in interface WebBrowser
waitUntilLoaded
- if true, it runs synchronously, waiting for the fully loaded page. This is always the case for the browser
WebBrowserBuilder.Engine.WEBDRIVER_FF
public void enableSilentPromptService(boolean b)
WebBrowser
enableSilentPromptService
in interface WebBrowser
b
- true to enablepublic DOMWindow getWindow()
WebBrowser
WebBrowser.getContentDOMWindow()
getWindow
in interface WebBrowser
public void close()
WebBrowser
DOMWindow
calling this
#getContentDOMWindow().close()
close
in interface AutoCloseable
close
in interface WebBrowser
Copyright © 2020 OXPath Team. All rights reserved.