Package com.crawljax.browser
Interface EmbeddedBrowser
-
- All Known Implementing Classes:
WebDriverBackedEmbeddedBrowser
public interface EmbeddedBrowserBrowser interface used by Crawljax.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classEmbeddedBrowser.BrowserTypeBrowser types.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidclose()Closes the browser.voidcloseOtherWindows()Closes all other windows.booleanelementExists(Identification identification)ObjectexecuteJavaScript(String script)Execute JavaScript in the browser.booleanfireEventAndWait(Eventable event)fires the event.StringgetCurrentUrl()StringgetDom()Deprecated.usegetStrippedDom().StringgetFrameDom(String iframeIdentification)FormInputgetInputWithRandomValue(FormInput inputForm)StringgetScreenShotAsBase64()BufferedImagegetScreenShotAsBufferedImage(int scrollTimeout)StringgetStrippedDom()Removes the stripped items fromPreCrawlConfiguration.getFilterAttributeNames().StringgetStrippedDomWithoutIframeContent()StringgetUnStrippedDom()Removes the stripped items fromPreCrawlConfiguration.getFilterAttributeNames().org.openqa.selenium.WebDrivergetWebDriver()org.openqa.selenium.WebElementgetWebElement(Identification identification)voidgoBack()Go back to the previous state.voidgoToUrl(URI url)Opens the url in the browser.voidhandlePopups()booleaninput(Identification identification, String text)booleanisVisible(Identification identification)Checks if an element is visible.voidsaveScreenShot(File file)
-
-
-
Method Detail
-
goToUrl
void goToUrl(URI url)
Opens the url in the browser.- Parameters:
url- the URL.
-
fireEventAndWait
boolean fireEventAndWait(Eventable event) throws org.openqa.selenium.ElementNotInteractableException, InterruptedException
fires the event.- Parameters:
event- the event.- Returns:
- if fails.
- Throws:
org.openqa.selenium.ElementNotInteractableExceptionInterruptedException
-
getStrippedDom
String getStrippedDom()
Removes the stripped items fromPreCrawlConfiguration.getFilterAttributeNames().- Returns:
- the DOM string with all the iframe content.
-
getUnStrippedDom
String getUnStrippedDom()
Removes the stripped items fromPreCrawlConfiguration.getFilterAttributeNames().- Returns:
- The dom without any elements stripped.
- See Also:
WebDriver.getPageSource()
-
getDom
@Deprecated String getDom()
Deprecated.usegetStrippedDom().- Returns:
- implemented by
getStrippedDom().
-
getStrippedDomWithoutIframeContent
String getStrippedDomWithoutIframeContent()
- Returns:
- the DOM string WITHOUT the iframe content.
-
close
void close()
Closes the browser.
-
closeOtherWindows
void closeOtherWindows()
Closes all other windows.
-
goBack
void goBack()
Go back to the previous state.
-
input
boolean input(Identification identification, String text) throws CrawljaxException
- Parameters:
identification- the identification.text- the text.- Returns:
- true if succeeded.
- Throws:
CrawljaxException- if fails.
-
executeJavaScript
Object executeJavaScript(String script) throws CrawljaxException
Execute JavaScript in the browser.- Parameters:
script- The script to execute.- Returns:
- The JavaScript return object.
- Throws:
CrawljaxException- On error.
-
isVisible
boolean isVisible(Identification identification)
Checks if an element is visible.- Parameters:
identification- identification to use.- Returns:
- true if the element is visible.
-
getCurrentUrl
String getCurrentUrl()
- Returns:
- The current browser url.
-
getInputWithRandomValue
FormInput getInputWithRandomValue(FormInput inputForm)
- Parameters:
inputForm- the input form.- Returns:
- a FormInput filled with random data.
-
getFrameDom
String getFrameDom(String iframeIdentification)
- Parameters:
iframeIdentification- the iframe's name or id.- Returns:
- the DOM string of the corresponding iframe.
-
elementExists
boolean elementExists(Identification identification)
- Parameters:
identification- the identification of the element to be checked.- Returns:
- true if the element can be found in the browser's DOM tree.
-
getWebElement
org.openqa.selenium.WebElement getWebElement(Identification identification)
- Parameters:
identification- the identification of the element to be found.- Returns:
- the corresponding WebElement from the browser.
-
getWebDriver
org.openqa.selenium.WebDriver getWebDriver()
- Returns:
- The selenium web driver.
-
saveScreenShot
void saveScreenShot(File file) throws CrawljaxException
- Parameters:
file- the file to write the screenshot to (png).- Throws:
CrawljaxException- if saving screenshots is not supported by the implementing class.
-
getScreenShotAsBufferedImage
BufferedImage getScreenShotAsBufferedImage(int scrollTimeout) throws CrawljaxException
- Throws:
CrawljaxException
-
getScreenShotAsBase64
String getScreenShotAsBase64() throws CrawljaxException
- Throws:
CrawljaxException
-
handlePopups
void handlePopups()
-
-