public final class WebDriverBackedEmbeddedBrowser extends Object implements EmbeddedBrowser
EmbeddedBrowser.BrowserType| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the browser.
|
void |
closeOtherWindows()
Closes all other windows.
|
boolean |
elementExists(Identification identification) |
Object |
executeJavaScript(String code)
Execute JavaScript in the browser.
|
boolean |
fireEventAndWait(Eventable eventable)
Fires an event on an element using its identification.
|
org.openqa.selenium.WebDriver |
getBrowser() |
protected long |
getCrawlWaitEvent() |
protected long |
getCrawlWaitReload() |
String |
getCurrentUrl() |
String |
getDom()
Deprecated.
|
protected com.google.common.collect.ImmutableSortedSet<String> |
getFilterAttributes() |
String |
getFrameDom(String iframeIdentification) |
FormInput |
getInputWithRandomValue(FormInput input) |
String |
getScreenShotAsBase64() |
BufferedImage |
getScreenShotAsBufferedImage(int scrollTime) |
String |
getStrippedDom()
Removes the stripped items from
PreCrawlConfiguration.getFilterAttributeNames(). |
String |
getStrippedDomWithoutIframeContent() |
String |
getUnStrippedDom()
Removes the stripped items from
PreCrawlConfiguration.getFilterAttributeNames(). |
org.openqa.selenium.WebDriver |
getWebDriver() |
org.openqa.selenium.WebElement |
getWebElement(Identification identification) |
void |
goBack()
Go back to the previous state.
|
void |
goToUrl(URI url)
Opens the url in the browser.
|
void |
handlePopups()
alert, prompt, and confirm behave as if the OK button is always clicked.
|
boolean |
input(Identification identification,
String text) |
boolean |
isVisible(Identification identification)
Determines whether the corresponding element is visible.
|
void |
saveScreenShot(File file) |
void |
setPixelDensity(int pixelDensity) |
static WebDriverBackedEmbeddedBrowser |
withDriver(org.openqa.selenium.WebDriver driver)
Create a WebDriver backed EmbeddedBrowser.
|
static WebDriverBackedEmbeddedBrowser |
withDriver(org.openqa.selenium.WebDriver driver,
com.google.common.collect.ImmutableSortedSet<String> filterAttributes,
long crawlWaitEvent,
long crawlWaitReload)
Create a WebDriver backed EmbeddedBrowser.
|
static WebDriverBackedEmbeddedBrowser |
withDriver(org.openqa.selenium.WebDriver driver,
com.google.common.collect.ImmutableSortedSet<String> filterAttributes,
long crawlWaitEvent,
long crawlWaitReload,
IgnoreFrameChecker ignoreFrameChecker)
Create a WebDriver backed EmbeddedBrowser.
|
static WebDriverBackedEmbeddedBrowser |
withRemoteDriver(String hubUrl)
Create a RemoteWebDriver backed EmbeddedBrowser.
|
static WebDriverBackedEmbeddedBrowser |
withRemoteDriver(String hubUrl,
com.google.common.collect.ImmutableSortedSet<String> filterAttributes,
long crawlWaitEvent,
long crawlWaitReload)
Create a RemoteWebDriver backed EmbeddedBrowser.
|
static WebDriverBackedEmbeddedBrowser |
withRemoteDriver(String hubUrl,
com.google.common.collect.ImmutableSortedSet<String> filterAttributes,
long crawlWaitEvent,
long crawlWaitReload,
IgnoreFrameChecker ignoreFrameChecker)
Create a RemoteWebDriver backed EmbeddedBrowser.
|
public static WebDriverBackedEmbeddedBrowser withRemoteDriver(String hubUrl, com.google.common.collect.ImmutableSortedSet<String> filterAttributes, long crawlWaitEvent, long crawlWaitReload)
hubUrl - Url of the server.filterAttributes - the attributes to be filtered from DOM.crawlWaitReload - the period to wait after a reload.crawlWaitEvent - the period to wait after an event is fired.public static WebDriverBackedEmbeddedBrowser withRemoteDriver(String hubUrl, com.google.common.collect.ImmutableSortedSet<String> filterAttributes, long crawlWaitEvent, long crawlWaitReload, IgnoreFrameChecker ignoreFrameChecker)
hubUrl - Url of the server.filterAttributes - the attributes to be filtered from DOM.crawlWaitReload - the period to wait after a reload.crawlWaitEvent - the period to wait after an event is fired.ignoreFrameChecker - the checker used to determine if a certain frame must be ignored.public static WebDriverBackedEmbeddedBrowser withDriver(org.openqa.selenium.WebDriver driver, com.google.common.collect.ImmutableSortedSet<String> filterAttributes, long crawlWaitEvent, long crawlWaitReload)
driver - The WebDriver to use.filterAttributes - the attributes to be filtered from DOM.crawlWaitReload - the period to wait after a reload.crawlWaitEvent - the period to wait after an event is fired.public static WebDriverBackedEmbeddedBrowser withDriver(org.openqa.selenium.WebDriver driver, com.google.common.collect.ImmutableSortedSet<String> filterAttributes, long crawlWaitEvent, long crawlWaitReload, IgnoreFrameChecker ignoreFrameChecker)
driver - The WebDriver to use.filterAttributes - the attributes to be filtered from DOM.crawlWaitReload - the period to wait after a reload.crawlWaitEvent - the period to wait after an event is fired.ignoreFrameChecker - the checker used to determine if a certain frame must be ignored.public static WebDriverBackedEmbeddedBrowser withRemoteDriver(String hubUrl)
hubUrl - Url of the server.public static WebDriverBackedEmbeddedBrowser withDriver(org.openqa.selenium.WebDriver driver)
driver - The WebDriver to use.public void goToUrl(URI url)
EmbeddedBrowsergoToUrl in interface EmbeddedBrowserurl - The URL.public void handlePopups()
handlePopups in interface EmbeddedBrowserpublic void close()
EmbeddedBrowserclose in interface EmbeddedBrowser@Deprecated public String getDom()
getDom in interface EmbeddedBrowserEmbeddedBrowser.getStrippedDom().public String getStrippedDom()
EmbeddedBrowserPreCrawlConfiguration.getFilterAttributeNames().getStrippedDom in interface EmbeddedBrowserpublic String getUnStrippedDom()
EmbeddedBrowserPreCrawlConfiguration.getFilterAttributeNames().getUnStrippedDom in interface EmbeddedBrowserWebDriver.getPageSource()public void goBack()
EmbeddedBrowsergoBack in interface EmbeddedBrowserpublic boolean input(Identification identification, String text)
input in interface EmbeddedBrowseridentification - The identification object.text - The input.public boolean fireEventAndWait(Eventable eventable) throws org.openqa.selenium.ElementNotVisibleException, org.openqa.selenium.NoSuchElementException, InterruptedException
fireEventAndWait in interface EmbeddedBrowsereventable - The eventable.InterruptedException - when interrupted during the wait.org.openqa.selenium.ElementNotVisibleExceptionorg.openqa.selenium.NoSuchElementExceptionpublic Object executeJavaScript(String code) throws CrawljaxException
executeJavaScript in interface EmbeddedBrowsercode - The code to execute.CrawljaxException - when javascript execution failed.public boolean isVisible(Identification identification)
isVisible in interface EmbeddedBrowseridentification - The element to search for.public String getCurrentUrl()
getCurrentUrl in interface EmbeddedBrowserpublic void closeOtherWindows()
EmbeddedBrowsercloseOtherWindows in interface EmbeddedBrowserpublic String getStrippedDomWithoutIframeContent()
getStrippedDomWithoutIframeContent in interface EmbeddedBrowserEmbeddedBrowser.getStrippedDomWithoutIframeContent()public FormInput getInputWithRandomValue(FormInput input)
getInputWithRandomValue in interface EmbeddedBrowserinput - the input to be filled.nullpublic String getFrameDom(String iframeIdentification)
getFrameDom in interface EmbeddedBrowseriframeIdentification - the iframe's name or id.public boolean elementExists(Identification identification)
elementExists in interface EmbeddedBrowseridentification - the identification of the element.public org.openqa.selenium.WebElement getWebElement(Identification identification)
getWebElement in interface EmbeddedBrowseridentification - the identification of the element.public org.openqa.selenium.WebDriver getWebDriver()
getWebDriver in interface EmbeddedBrowserprotected long getCrawlWaitEvent()
protected com.google.common.collect.ImmutableSortedSet<String> getFilterAttributes()
protected long getCrawlWaitReload()
public void saveScreenShot(File file) throws CrawljaxException
saveScreenShot in interface EmbeddedBrowserfile - the file to write the screenshot to (png).CrawljaxException - if saving screenshots is not supported by the implementing class.public BufferedImage getScreenShotAsBufferedImage(int scrollTime)
getScreenShotAsBufferedImage in interface EmbeddedBrowserpublic String getScreenShotAsBase64() throws CrawljaxException
getScreenShotAsBase64 in interface EmbeddedBrowserCrawljaxExceptionpublic org.openqa.selenium.WebDriver getBrowser()
public void setPixelDensity(int pixelDensity)
Copyright © 2007–2019. All rights reserved.