N - Original web browser enclosed (wrapped) by this class.public abstract class AbstractWebBrowser<N> extends Object implements WebBrowser
WebBrowser.ContentType, WebBrowser.OptionsMiniBrowser.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, waitaddLocationListener, 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, switchToFrameback, getActionExecutor, getAdviceProcessor, getLocationURL, navigate, navigateprotected abstract N getBrowser()
public URL getURL()
WebBrowserMiniBrowser.getLocationURL() but as a URL. Returns null if the URL is not valid.getURL in interface MiniBrowsergetURL in interface WebBrowserpublic BrowserStats stats()
stats in interface WebBrowserpublic DOMElement getDOMElementByLocator(String xPathLocator) throws WebAPINoSuchElementException
MiniBrowsergetDOMElementByLocator in interface MiniBrowserWebAPINoSuchElementException - if the element is not found, or the found node is not an element nodepublic void setPageLoadingTimeout(long time,
TimeUnit unit)
WebBrowserWebBrowser.navigate(String, boolean) will throw exceptions.setPageLoadingTimeout in interface WebBrowserpublic File takeScreenshot()
WebBrowsertakeScreenshot in interface WebBrowserpublic JSUtils js()
js in interface WebBrowserpublic void navigate(URI uri, boolean waitUntilLoaded)
WebBrowsernavigate in interface WebBrowserwaitUntilLoaded - if true, it runs synchronously, waiting for the fully loaded page. This is always the case for the browser
WebBrowserBuilder.Engine.WEBDRIVER_FFpublic void enableSilentPromptService(boolean b)
WebBrowserenableSilentPromptService in interface WebBrowserb - true to enablepublic DOMWindow getWindow()
WebBrowserWebBrowser.getContentDOMWindow()getWindow in interface WebBrowserpublic void close()
WebBrowserDOMWindow calling this
#getContentDOMWindow().close()close in interface AutoCloseableclose in interface WebBrowserCopyright © 2020 OXPath Team. All rights reserved.