| Constructor and Description |
|---|
WebDroneImpl(org.openqa.selenium.WebDriver driver)
Constructor with default time set to 2000 milliseconds.
|
WebDroneImpl(org.openqa.selenium.WebDriver driver,
long defaultWaitTime,
long maxPageRenderWaitTime)
The main constructor
|
WebDroneImpl(org.openqa.selenium.WebDriver driver,
long defaultWaitTime,
long maxPageRenderWaitTime,
WebDroneProperties properties,
PageFactory factoryPage)
The main constructor
|
WebDroneImpl(org.openqa.selenium.WebDriver driver,
WebDroneProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAndType(org.openqa.selenium.By by,
String value)
Find element and send keys.
|
void |
closeTab()
Closes the recently opened tab in the same browser.
|
void |
closeWindow()
This method closes the current window or tab.
|
void |
createNewTab()
Opens the new tab in the same browser.
|
void |
deleteCookie(org.openqa.selenium.Cookie cookie)
Delete cookie based on given cookie.
|
void |
deleteCookies()
Function to delete the cookies in the browser
|
void |
doubleClickOnElement(org.openqa.selenium.WebElement element)
Doubleclick on an element
|
void |
dragAndDrop(org.openqa.selenium.WebElement source,
int x,
int y)
Drag and drop element by x,y
|
void |
dragAndDrop(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
|
Object |
executeJavaScript(String js,
Object... args)
Execute java script in resepect of object (i.e.
|
protected void |
finalize()
Clean up
WebDrone. |
org.openqa.selenium.WebElement |
find(org.openqa.selenium.By by)
Helper method to find a
WebElement. |
org.openqa.selenium.WebElement |
find(int x,
int y)
Find
WebElement by x and y coordinates. |
org.openqa.selenium.WebElement |
find(org.sikuli.api.Target target)
Finds
WebElement by using an image. |
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 |
findAndWaitWithRefresh(org.openqa.selenium.By by)
Helper method to find and return a slow loading
WebElement. |
org.openqa.selenium.WebElement |
findAndWaitWithRefresh(org.openqa.selenium.By by,
long limit)
Helper method to find a
WebElement with a time limit in
milliseconds. |
org.openqa.selenium.WebElement |
findByKey(String id)
Helper method to find a
WebElement by id using the WebDroneProperties to resolve the key value of the id. |
List<org.openqa.selenium.WebElement> |
findDisplayedElements(org.openqa.selenium.By selector)
This function will return list of visible elements found with the specified selector
|
org.openqa.selenium.WebElement |
findFirstDisplayedElement(org.openqa.selenium.By selector)
This function will return 1st visible element found with the specified selector
|
org.openqa.selenium.interactions.Actions |
getActions()
Get a new instance of
Actions. |
org.openqa.selenium.Cookie |
getCookie(String name)
Gets the cookie from the WebDrone browser session.
|
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()
Get the default wait time value.
|
org.openqa.selenium.WebDriver |
getDriver() |
String |
getElement(String key)
Gets an element value for the given key.
|
long |
getMaxPageRenderWaitTime() |
String |
getPageSouce()
The HTML source code of the page viewed.
|
String |
getPreviousUrl()
Gets the URL of the previously visited page.
|
WebDroneProperties |
getProperties()
Get the WebDrone property which contains additional information
such as the page object library, version details or language.
|
File |
getScreenShot()
Grabs a screen shot of what the
WebDriver is currently viewing. |
String |
getSessionId()
Gets the WebDrone browser session id from a cookie.
|
String |
getTitle()
Title of the page.
|
String |
getValue(String key)
Check value of given key, such as string value
of an i18n label.
|
String |
getWindowHandle()
This method finds the current window handle and return it as string.
|
Set<String> |
getWindowHandles()
This method finds the all window handles and return it as string.
|
boolean |
isElementDisplayed(org.openqa.selenium.By locator)
Returns true if the element is displayed else false.
|
boolean |
isImageVisible(org.sikuli.api.Target target)
Finds the target image in the screen.
|
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 |
maximize()
Maximizes the current window if it is not already maximized
|
void |
mouseOver(org.openqa.selenium.WebElement element)
Recreating the action of hovering over a particular HTML element on a page.
|
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 |
rightClickOnElement(org.openqa.selenium.WebElement element)
Rightclick on an element
|
void |
setDefaultWaitTime(long defaultWaitTime) |
void |
switchToDefaultContent()
Method to switch back from i-frame to default content.
|
void |
switchToFrame(String frameId)
Method to switch on to frames of content object.
|
void |
switchToWindow(String windowHandle)
This method transfers the control to the specific window as per the given window handle.
|
String |
toString() |
void |
waitForElement(org.openqa.selenium.By locator,
long timeOutInSeconds)
Wait until the element is visible for the specified amount of time.
|
void |
waitForPageLoad(long timeOutInSeconds)
Wait document.readyState to return completed.
|
void |
waitForWindowsCount(int expectedNoOfWindows,
long timeOutInSeconds)
Wait until the windows count are displayed in set time in seconds.
|
void |
waitUntilElementClickable(org.openqa.selenium.By locator,
long timeOutInSeconds)
Wait until the Clickable of given Element for given seconds.
|
void |
waitUntilElementDeletedFromDom(org.openqa.selenium.By locator,
long timeOutInSeconds)
Wait Until element successfully deleting from DOM.
|
void |
waitUntilElementDisappears(org.openqa.selenium.By locator,
long timeOutInSeconds)
Wait until the invisibility of given Element for given seconds.
|
void |
waitUntilElementPresent(org.openqa.selenium.By locator,
long timeOutInSeconds)
Wait until the element is present in set time in seconds.
|
void |
waitUntilNotVisible(org.openqa.selenium.By locator,
String text,
long timeOutInSeconds)
Wait until the invisibility of given Element for given seconds.
|
void |
waitUntilNotVisibleWithParitalText(org.openqa.selenium.By locator,
String text,
long timeOutInSeconds)
Wait until the invisibility of given Element for given seconds.
|
void |
waitUntilVisible(org.openqa.selenium.By locator,
String text,
long timeOutInSeconds)
Wait until the element is visible in set time in seconds.
|
public WebDroneImpl(org.openqa.selenium.WebDriver driver)
driver - WebDriver the browser behaviorpublic WebDroneImpl(org.openqa.selenium.WebDriver driver,
WebDroneProperties properties)
public WebDroneImpl(org.openqa.selenium.WebDriver driver,
long defaultWaitTime,
long maxPageRenderWaitTime)
driver - WebDriver the browserdefaultWaitTime - time to wait in millisecondsmaxPageRenderWaitTime - maximum time to wait for page to renderpublic WebDroneImpl(org.openqa.selenium.WebDriver driver,
long defaultWaitTime,
long maxPageRenderWaitTime,
WebDroneProperties properties,
PageFactory factoryPage)
driver - WebDriver the browserdefaultWaitTime - time to wait in millisecondsmaxPageRenderWaitTime - maximum time to wait for page to renderproperties - page object related propertiesfactoryPage - PageFactory concrete implementationpublic boolean isReady()
public void quit()
WebDronepublic void navigateTo(String url)
WebDronenavigateTo in interface WebDroneurl - String URLpublic org.openqa.selenium.WebElement find(org.openqa.selenium.By by)
WebElement.public org.openqa.selenium.WebElement findByKey(String id)
WebElement by id using the WebDroneProperties to resolve the key value of the id.public List<org.openqa.selenium.WebElement> findAll(org.openqa.selenium.By by)
WebElement on HTML pagepublic 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 bylimit - millisecond time limitWebElement HTML elementpublic 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 frequencyWebElement HTML elementpublic boolean isRenderComplete(long waitTime)
isRenderComplete in interface WebDronewaitTime - max time to look for an elementpublic org.openqa.selenium.WebElement findAndWaitById(String id)
WebElement by id.findAndWaitById in interface WebDroneid - String identifierWebElement HTML elementpublic org.openqa.selenium.WebElement findAndWait(org.openqa.selenium.By criteria)
WebElement.findAndWait in interface WebDronecriteria - By search criteriaWebElement HTML elementpublic List<org.openqa.selenium.WebElement> findAndWaitForElements(org.openqa.selenium.By criteria, long waitTime)
WebElement.findAndWaitForElements in interface WebDronecriteria - By search criteriawaitTime - milliseconds to waitWebElement HTML elementspublic List<org.openqa.selenium.WebElement> findAndWaitForElements(org.openqa.selenium.By criteria)
WebElement.findAndWaitForElements in interface WebDronecriteria - By search criteriaWebElement HTML elementspublic void setDefaultWaitTime(long defaultWaitTime)
public long getDefaultWaitTime()
WebDronegetDefaultWaitTime in interface WebDronepublic void mouseOver(org.openqa.selenium.WebElement element)
public final String getElement(String key)
WebDronegetElement in interface WebDronekey - String HTML element idpublic String getCurrentUrl()
WebDronegetCurrentUrl in interface WebDronepublic Object executeJavaScript(String js)
executeJavaScript in interface WebDronejs - String scriptObject reponse of the javascriptpublic 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 void refresh()
WebDronepublic long getMaxPageRenderWaitTime()
public org.openqa.selenium.WebDriver getDriver()
public String getSessionId()
getSessionId in interface WebDronepublic Set<org.openqa.selenium.Cookie> getCookies()
public void dragAndDrop(org.openqa.selenium.WebElement source,
org.openqa.selenium.WebElement target)
dragAndDrop in interface WebDronesource - - Source Elementtarget - - Target Elementpublic void dragAndDrop(org.openqa.selenium.WebElement source,
int x,
int y)
dragAndDrop in interface WebDronesource - html elementx - coordinatey - coordinatepublic void doubleClickOnElement(org.openqa.selenium.WebElement element)
doubleClickOnElement in interface WebDroneelement - WebElementpublic void rightClickOnElement(org.openqa.selenium.WebElement element)
rightClickOnElement in interface WebDroneelement - WebElementpublic void waitUntilElementDisappears(org.openqa.selenium.By locator,
long timeOutInSeconds)
waitUntilElementDisappears in interface WebDronelocator - CSS LocatortimeOutInSeconds - Timeout In Secondspublic void waitUntilNotVisible(org.openqa.selenium.By locator,
String text,
long timeOutInSeconds)
waitUntilNotVisible in interface WebDronelocator - CSS Locatortext - - The Text to find in the LocatortimeOutInSeconds - Timeout In Secondspublic void waitUntilNotVisibleWithParitalText(org.openqa.selenium.By locator,
String text,
long timeOutInSeconds)
waitUntilNotVisibleWithParitalText in interface WebDronelocator - CSS Locatortext - - The Text to find in the LocatortimeOutInSeconds - Timeout In Secondspublic void waitUntilVisible(org.openqa.selenium.By locator,
String text,
long timeOutInSeconds)
WebDronewaitUntilVisible in interface WebDronelocator - CSS Locatortext - - The Text to find in the LocatortimeOutInSeconds - Timeout In Secondspublic void waitUntilElementPresent(org.openqa.selenium.By locator,
long timeOutInSeconds)
WebDronewaitUntilElementPresent in interface WebDronelocator - CSS LocatortimeOutInSeconds - Timeout In Secondspublic void waitForElement(org.openqa.selenium.By locator,
long timeOutInSeconds)
waitForElement in interface WebDronelocator - CSS LocatortimeOutInSeconds - Timeout In Secondspublic void waitUntilElementClickable(org.openqa.selenium.By locator,
long timeOutInSeconds)
waitUntilElementClickable in interface WebDronelocator - CSS LocatortimeOutInSeconds - Timeout In Secondspublic void waitUntilElementDeletedFromDom(org.openqa.selenium.By locator,
long timeOutInSeconds)
waitUntilElementDeletedFromDom in interface WebDronelocator - - CSS LocatortimeOutInSeconds - - Timeout In Secondspublic String getPreviousUrl()
WebDronegetPreviousUrl in interface WebDronepublic void switchToFrame(String frameId)
WebDroneswitchToFrame in interface WebDroneframeId - String identifierpublic void switchToDefaultContent()
WebDroneswitchToDefaultContent in interface WebDronepublic boolean isElementDisplayed(org.openqa.selenium.By locator)
WebDroneisElementDisplayed in interface WebDronelocator - By querypublic String getWindowHandle()
getWindowHandle in interface WebDronepublic Set<String> getWindowHandles()
getWindowHandles in interface WebDronepublic void switchToWindow(String windowHandle)
switchToWindow in interface WebDronewindowHandle - name of windowpublic void closeWindow()
closeWindow in interface WebDronepublic void waitForWindowsCount(int expectedNoOfWindows,
long timeOutInSeconds)
waitForWindowsCount in interface WebDroneexpectedNoOfWindows - -the expected number of windows to be displayedtimeOutInSeconds - - timeout in secondspublic org.openqa.selenium.Cookie getCookie(String name)
public void deleteCookie(org.openqa.selenium.Cookie cookie)
WebDronedeleteCookie in interface WebDronecookie - Cookie object to be deleted.public void deleteCookies()
deleteCookies in interface WebDronepublic void waitForPageLoad(long timeOutInSeconds)
waitForPageLoad in interface WebDronetimeOutInSeconds - time durationpublic void createNewTab()
createNewTab in interface WebDronepublic void closeTab()
public org.openqa.selenium.WebElement findAndWaitWithRefresh(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. If the element is not displayed, refresh the page.findAndWaitWithRefresh in interface WebDroneby - By criteria to search bylimit - duration leftWebElementpublic org.openqa.selenium.WebElement findAndWaitWithRefresh(org.openqa.selenium.By by)
WebElement.
If the element is not displayed, refresh the pagefindAndWaitWithRefresh in interface WebDroneby - By search criteriaWebElement HTML elementpublic Object executeJavaScript(String js, Object... args)
executeJavaScript in interface WebDronejs - String scriptargs - optional objectsObject reponse of the javascriptpublic HtmlPage getCurrentPage()
WebDroneHtmlPage object.getCurrentPage in interface WebDroneHtmlPage page object of current viewpublic WebDroneProperties getProperties()
WebDronegetProperties in interface WebDroneWebDroneProperties propertiespublic void maximize()
WebDronepublic String getValue(String key)
WebDronepublic List<org.openqa.selenium.WebElement> findDisplayedElements(org.openqa.selenium.By selector)
findDisplayedElements in interface WebDroneselector - By identifierList of WebElementpublic org.openqa.selenium.WebElement findFirstDisplayedElement(org.openqa.selenium.By selector)
findFirstDisplayedElement in interface WebDroneselector - By selector typeWebElement element to interactpublic boolean isImageVisible(org.sikuli.api.Target target)
WebDroneisImageVisible in interface WebDronetarget - Target image we are looking for in the screen.public org.openqa.selenium.WebElement find(org.sikuli.api.Target target)
WebDroneWebElement by using an image.public org.openqa.selenium.WebElement find(int x,
int y)
WebDroneWebElement by x and y coordinates.public void clearAndType(org.openqa.selenium.By by,
String value)
WebDroneKeys number.
clearAndType in interface WebDroneby - - To find the elementvalue - - Text to entered on text boxpublic org.openqa.selenium.interactions.Actions getActions()
WebDroneActions.getActions in interface WebDroneActions action.Copyright © 2015. All rights reserved.