|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.alfresco.webdrone.WebDroneImpl
public class WebDroneImpl
An Alfresco web browser simulator that uses Selenium WebDriver as a base with added helper methods that are specific to Alfresco site and version.
| Constructor Summary | |
|---|---|
WebDroneImpl(org.openqa.selenium.WebDriver driver,
AlfrescoVersion alfrescoVersion)
Constructor with default time set to 2000 milliseconds. |
|
WebDroneImpl(org.openqa.selenium.WebDriver driver,
AlfrescoVersion alfrescoVersion,
long defaultWaitTime,
long maxPageRenderWaitTime)
The main constructor |
|
| Method Summary | |
|---|---|
void |
dranAndDrop(org.openqa.selenium.WebElement source,
org.openqa.selenium.WebElement target)
Drag the source element and drop into target element. |
Object |
executeJavaScript(String js)
Injects java script directly to the page to invoke a change on the page's java script |
protected void |
finalize()
Clean up WebDrone. |
org.openqa.selenium.WebElement |
find(org.openqa.selenium.By by)
Helper method to find a WebElement. |
List<org.openqa.selenium.WebElement> |
findAll(org.openqa.selenium.By by)
Helper method to find all WebElement on HTML page |
org.openqa.selenium.WebElement |
findAndWait(org.openqa.selenium.By criteria)
Helper method to find and return a slow loading WebElement. |
org.openqa.selenium.WebElement |
findAndWait(org.openqa.selenium.By by,
long limit)
Helper method to find a WebElement with a time limit in
milliseconds. |
org.openqa.selenium.WebElement |
findAndWait(org.openqa.selenium.By by,
long limit,
long interval)
Helper method to find a WebElement with a time limit in
milliseconds. |
org.openqa.selenium.WebElement |
findAndWaitById(String id)
Helper method to find and return a slow loading WebElement by id. |
List<org.openqa.selenium.WebElement> |
findAndWaitForElements(org.openqa.selenium.By criteria)
Helper method to find and return a slow loading collection of WebElement. |
List<org.openqa.selenium.WebElement> |
findAndWaitForElements(org.openqa.selenium.By criteria,
long waitTime)
Helper method to find and return a slow loading collection of WebElement. |
org.openqa.selenium.WebElement |
findById(String id)
Helper method to find a WebElement by id using the
WebDroneProperties to resolve the key value of the id. |
AlfrescoVersion |
getAlfrescoVersion()
Gets the AlfrescoVersion that is used. |
Set<org.openqa.selenium.Cookie> |
getCookies()
Extract cookie information |
HtmlPage |
getCurrentPage()
Gets the current page in the form of a page object based on the Alfresco site type. |
String |
getCurrentUrl()
Get the URL displayed on the browser. |
long |
getDefaultWaitTime()
|
org.openqa.selenium.WebDriver |
getDriver()
|
String |
getElement(String key)
Gets the HTML element id value for the given key. |
long |
getMaxPageRenderWaitTime()
|
String |
getPageSouce()
The HTML source code of the page viewed. |
File |
getScreenShot()
Grabs a screen shot of what the WebDriver is currently viewing. |
String |
getTitle()
Title of the page. |
boolean |
isChromeBrowser()
Checks to see if driver used is chrome. |
boolean |
isHtmlUnit()
Checks to see if driver used is HtmlUnit. |
boolean |
isReady()
|
boolean |
isRenderComplete(long waitTime)
Verify if loading of the page is complete using java script to validate state of the HTML DOM. |
void |
mouseOver(org.openqa.selenium.WebElement element)
Recreating the action of hovering over a particular HTML element on a page. |
void |
mouseOverOnElement(org.openqa.selenium.WebElement element)
Recreating the action of hovering over a particular HTML element on a page based Actions class. |
void |
navigateTo(String url)
Navigate the browser to given URL. |
void |
quit()
End Browser session. |
void |
refresh()
Acts as a refresh page action similar to F5 key. |
void |
setDefaultWaitTime(long defaultWaitTime)
|
String |
toString()
|
void |
waitForElement(org.openqa.selenium.By locator,
long timeOutInSeconds)
Wait until the element is visible for the specified amount of time. |
void |
waitUntilElementDisappears(org.openqa.selenium.By locator,
long timeOutInSeconds)
Wait until the invisibility of given Element for given seconds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WebDroneImpl(org.openqa.selenium.WebDriver driver,
AlfrescoVersion alfrescoVersion)
driver - WebDriver the browser behaviouralfrescoVersion - AlfrescoVersion version
public WebDroneImpl(org.openqa.selenium.WebDriver driver,
AlfrescoVersion alfrescoVersion,
long defaultWaitTime,
long maxPageRenderWaitTime)
driver - WebDriver the browser behaviouralfrescoVersion - AlfrescoVersion versiondefaultWaitTime - time to wait in millisecondsmaxPageRenderWaitTime - maximum time to wait for page to render| Method Detail |
|---|
public boolean isReady()
isReady in interface WebDronepublic void quit()
WebDrone
quit in interface WebDronepublic void navigateTo(String url)
WebDrone
navigateTo in interface WebDroneurl - String URLpublic HtmlPage getCurrentPage()
WebDroneSharePage object.
getCurrentPage in interface WebDronepublic org.openqa.selenium.WebElement find(org.openqa.selenium.By by)
WebElement.
find in interface WebDroneby - By criteria to identify HTML element
WebElement HTML elementpublic org.openqa.selenium.WebElement findById(String id)
WebElement by id using the
WebDroneProperties to resolve the key value of the id.
findById in interface WebDroneid - the html element id
WebElement HTML elementpublic List<org.openqa.selenium.WebElement> findAll(org.openqa.selenium.By by)
WebElement on HTML page
findAll in interface WebDroneby - By criteria to identify HTML element
WebElement HTML element
public org.openqa.selenium.WebElement findAndWait(org.openqa.selenium.By by,
long limit)
WebElement with a time limit in
milliseconds. During the wait period it will check for the element every
100 millisecond.
findAndWait in interface WebDroneby - By criteria to search bymillisecond - time limit
WebElement HTML element
public org.openqa.selenium.WebElement findAndWait(org.openqa.selenium.By by,
long limit,
long interval)
WebElement with a time limit in
milliseconds. During the wait period it will check for the element every
100 millisecond.
findAndWait in interface WebDroneby - By criteria to search bylimit - time limitinterval - polling frequency
WebElement HTML elementpublic boolean isRenderComplete(long waitTime)
isRenderComplete in interface WebDronewaitTime - max time to look for an element
public org.openqa.selenium.WebElement findAndWaitById(String id)
WebElement by id.
findAndWaitById in interface WebDroneid - String identifier
WebElement HTML elementpublic org.openqa.selenium.WebElement findAndWait(org.openqa.selenium.By criteria)
WebElement.
findAndWait in interface WebDronecriteria - By search criteria
WebElement HTML element
public List<org.openqa.selenium.WebElement> findAndWaitForElements(org.openqa.selenium.By criteria,
long waitTime)
WebElement.
findAndWaitForElements in interface WebDronecriteria - By search criteriawaitTime - milliseconds to wait
WebElement HTML elementspublic List<org.openqa.selenium.WebElement> findAndWaitForElements(org.openqa.selenium.By criteria)
WebElement.
findAndWaitForElements in interface WebDronecriteria - By search criteria
WebElement HTML elementspublic void setDefaultWaitTime(long defaultWaitTime)
public long getDefaultWaitTime()
public void mouseOver(org.openqa.selenium.WebElement element)
mouseOver in interface WebDroneelement - WebElement targetpublic final String getElement(String key)
WebDrone
getElement in interface WebDronekey - String HTML element id
public String getCurrentUrl()
WebDrone
getCurrentUrl in interface WebDronepublic Object executeJavaScript(String js)
executeJavaScript in interface WebDronejs - String script
Object reponse of the javascriptpublic String getTitle()
WebDrone
getTitle in interface WebDronepublic AlfrescoVersion getAlfrescoVersion()
WebDroneAlfrescoVersion that is used.
getAlfrescoVersion in interface WebDroneAlfrescoVersionpublic String getPageSouce()
public final File getScreenShot()
WebDriver is currently viewing.
This is only possible on WebDriver that are UI based browser.
getScreenShot in interface WebDroneFile screen image of the pagepublic String toString()
toString in class Object
protected void finalize()
throws Throwable
WebDrone.
finalize in class ObjectThrowablepublic void refresh()
WebDrone
refresh in interface WebDronepublic long getMaxPageRenderWaitTime()
public org.openqa.selenium.WebDriver getDriver()
public boolean isChromeBrowser()
public boolean isHtmlUnit()
public Set<org.openqa.selenium.Cookie> getCookies()
drone - WebDrone
public void dranAndDrop(org.openqa.selenium.WebElement source,
org.openqa.selenium.WebElement target)
dranAndDrop in interface WebDronesource - - Source Elementtarget - - Target Element
public void waitUntilElementDisappears(org.openqa.selenium.By locator,
long timeOutInSeconds)
waitUntilElementDisappears in interface WebDronelocator - CSS LocatortimeOutInSeconds - Timeout In Secondspublic void mouseOverOnElement(org.openqa.selenium.WebElement element)
Actions class.
mouseOverOnElement in interface WebDroneelement - WebElement target
public void waitForElement(org.openqa.selenium.By locator,
long timeOutInSeconds)
waitForElement in interface WebDronelocator - CSS LocatortimeOutInSeconds - Timeout In Seconds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||