public interface WebDrone
Key methods are findAndWaitById(String), which is used to find elements on the page using the id as an identifier.
The other various methods similar to findAndWait(By) are also used to find elements of the page.
The executeJavaScript(String) is an added functionality to manage JavaScript encountered on the page. The primary use of the method is to
inject a script to yield a user based behaviour.
| Modifier and Type | Method and Description |
|---|---|
void |
clearAndType(org.openqa.selenium.By by,
String value)
Find the element the clear any text and type text into the text box.
|
void |
closeTab()
Closes the recently opened tab in the same browser.
|
void |
closeWindow()
This method closes the current window or tab.
|
void |
createNewTab()
Create new tab.
|
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 web element by x,y coordinates
|
void |
dragAndDrop(org.openqa.selenium.WebElement source,
org.openqa.selenium.WebElement target)
Drag the source element and drop into target element.
|
Object |
executeJavaScript(String string)
Actions custom javascript that needs to be injected
to the current page.
|
Object |
executeJavaScript(String js,
Object... args)
Execute java script in resepect of object (i.e.
|
org.openqa.selenium.WebElement |
find(org.openqa.selenium.By by)
Finds
WebElement by text in html. |
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)
Finds all possible matching
WebElement. |
org.openqa.selenium.WebElement |
findAndWait(org.openqa.selenium.By by)
Find
WebElement by the html name attribute. |
org.openqa.selenium.WebElement |
findAndWait(org.openqa.selenium.By by,
long timeLeft)
Finds
WebElement using By pattern with a
time limit set in milliseconds. |
org.openqa.selenium.WebElement |
findAndWait(org.openqa.selenium.By by,
long timeLeft,
long interval)
Finds
WebElement using By pattern with a
time limit and interval time set in milliseconds. |
org.openqa.selenium.WebElement |
findAndWaitById(String id)
Finds
WebElement by id, this method uses an
implicit wait time which set by the WebDrone max wait time. |
List<org.openqa.selenium.WebElement> |
findAndWaitForElements(org.openqa.selenium.By by)
Finds all possible matching
WebElement with time limit. |
List<org.openqa.selenium.WebElement> |
findAndWaitForElements(org.openqa.selenium.By criteria,
long waitTime)
Finds all possible matching
WebElement with time limit. |
org.openqa.selenium.WebElement |
findAndWaitWithRefresh(org.openqa.selenium.By by)
Find
WebElement by the html name attribute. |
org.openqa.selenium.WebElement |
findAndWaitWithRefresh(org.openqa.selenium.By by,
long timeLeft)
Finds
WebElement using By pattern with a
time limit set in milliseconds. |
org.openqa.selenium.WebElement |
findByKey(String key)
Finds the
WebElement by the given identifier. |
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.Cookie |
getCookie(String name)
Get a cookie that matches the name.
|
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.
|
String |
getElement(String key)
Gets an element value for the given key.
|
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 the screen shot of the current page.
|
String |
getSessionId()
Get the JSESSIONID
|
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 returns the set of string values.
|
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 timeLeft)
Verify if the page has completed render.
|
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 |
mouseOverOnElement(org.openqa.selenium.WebElement element)
Recreating the action of hovering over a particular HTML element on a
page based
WebElement 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 |
rightClickOnElement(org.openqa.selenium.WebElement element)
Rightclick on an element
|
void |
sendkeys(org.openqa.selenium.Keys... keysToSend) |
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.
|
void |
waitFor(long waitTimeMS)
Deprecated.
as of 2.2, this method should not be use, since it pauses a process for a set time unconditionally, its the same as thread sleep.
|
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 given click able element is found within the time set in 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 element is not visible in set time in 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.
|
boolean isReady()
void quit()
void navigateTo(String url)
url - String URLHtmlPage getCurrentPage()
HtmlPage` object.String getElement(String key)
key - String HTML element idString getCurrentUrl()
String getTitle()
String getSessionId()
File getScreenShot()
File image of page.org.openqa.selenium.WebElement find(org.openqa.selenium.By by)
WebElement by text in html.by - selectorWebElement html elementboolean isRenderComplete(long timeLeft)
timeLeft - the maximum time allocated to do the taskorg.openqa.selenium.WebElement findAndWait(org.openqa.selenium.By by)
WebElement by the html name attribute.{@link - By}WebElement web elementorg.openqa.selenium.WebElement findAndWaitById(String id)
WebElement by id, this method uses an
implicit wait time which set by the WebDrone max wait time.
The method will return once the html element is found
or up to max wait time has exceeded.id - String identifierWebElement web elementorg.openqa.selenium.WebElement findAndWaitWithRefresh(org.openqa.selenium.By by)
WebElement by the html name attribute.{@link - By}WebElement web elementorg.openqa.selenium.WebElement findByKey(String key)
WebElement by the given identifier.key - identifierWebElement html elementString getValue(String key)
key - identifierorg.openqa.selenium.WebElement findAndWait(org.openqa.selenium.By by,
long timeLeft)
WebElement using By pattern with a
time limit set in milliseconds.
The method will return once the html element is found or
up to time limit set has exceeded.by - method to find element on pagetimeLeft - WebElement element searchedorg.openqa.selenium.WebElement findAndWaitWithRefresh(org.openqa.selenium.By by,
long timeLeft)
WebElement using By pattern with a
time limit set in milliseconds.
The method will return once the html element is found or
up to time limit set has exceeded.by - method to find element on pagetimeLeft - WebElement element searchedorg.openqa.selenium.WebElement findAndWait(org.openqa.selenium.By by,
long timeLeft,
long interval)
WebElement using By pattern with a
time limit and interval time set in milliseconds.
The method will return once the html element is found or
up to time limit set has exceeded. This method also allows
to set the polling frequency.by - method to find element on pagetimeLeft - interval - WebElement element searchedObject executeJavaScript(String string)
string - javascript codeObject reponse of the javascriptList<org.openqa.selenium.WebElement> findAll(org.openqa.selenium.By by)
WebElement.by - By criteriaList<org.openqa.selenium.WebElement> findAndWaitForElements(org.openqa.selenium.By criteria, long waitTime)
WebElement with time limit.criteria - BywaitTime - the max time to waitList<org.openqa.selenium.WebElement> findAndWaitForElements(org.openqa.selenium.By by)
WebElement with time limit.by - By the criteria to search by.void refresh()
void mouseOver(org.openqa.selenium.WebElement element)
element - WebElement targetvoid mouseOverOnElement(org.openqa.selenium.WebElement element)
WebElement class. Actions class.element - WebElement targetvoid dragAndDrop(org.openqa.selenium.WebElement source,
org.openqa.selenium.WebElement target)
source - Source WebElementtarget - Target WebElementvoid dragAndDrop(org.openqa.selenium.WebElement source,
int x,
int y)
source - html WebElementx - coordinatey - coordinatevoid doubleClickOnElement(org.openqa.selenium.WebElement element)
element - WebElementvoid rightClickOnElement(org.openqa.selenium.WebElement element)
element - WebElementvoid waitUntilElementDisappears(org.openqa.selenium.By locator,
long timeOutInSeconds)
locator - CSS LocatortimeOutInSeconds - Timeout In Secondsvoid waitForElement(org.openqa.selenium.By locator,
long timeOutInSeconds)
locator - CSS LocatortimeOutInSeconds - Timeout In Secondsvoid waitUntilNotVisible(org.openqa.selenium.By locator,
String text,
long timeOutInSeconds)
locator - CSS Locatortext - - The Text to find in the LocatortimeOutInSeconds - Timeout In Secondsvoid waitUntilVisible(org.openqa.selenium.By locator,
String text,
long timeOutInSeconds)
locator - CSS Locatortext - - The Text to find in the LocatortimeOutInSeconds - Timeout In Secondsvoid waitUntilElementClickable(org.openqa.selenium.By locator,
long timeOutInSeconds)
locator - CSS LocatortimeOutInSeconds - Timeout In Secondsvoid waitFor(long waitTimeMS)
long - waitTimevoid waitUntilElementDeletedFromDom(org.openqa.selenium.By locator,
long timeOutInSeconds)
locator - - CSS LocatortimeOutInSeconds - - Timeout In SecondsString getPreviousUrl()
void switchToFrame(String frameId)
frameId - void switchToDefaultContent()
boolean isElementDisplayed(org.openqa.selenium.By locator)
String getWindowHandle()
void switchToWindow(String windowHandle)
windowHandle - Set<String> getWindowHandles()
void closeWindow()
org.openqa.selenium.Cookie getCookie(String name)
String - cookie identifiervoid deleteCookies()
drone - WebDronevoid deleteCookie(org.openqa.selenium.Cookie cookie)
cookie - Cookie object to be deleted.void waitForPageLoad(long timeOutInSeconds)
timeOutInSeconds - void createNewTab()
void closeTab()
Object executeJavaScript(String js, Object... args)
string - javascript codeObject reponse of the javascriptvoid waitUntilElementPresent(org.openqa.selenium.By locator,
long timeOutInSeconds)
locator - CSS LocatortimeOutInSeconds - Timeout In Secondsvoid waitUntilNotVisibleWithParitalText(org.openqa.selenium.By locator,
String text,
long timeOutInSeconds)
locator - CSS Locatortext - - The Text to find in the LocatortimeOutInSeconds - Timeout In Secondsvoid waitForWindowsCount(int expectedNoOfWindows,
long timeOutInSeconds)
expectedNoOfWindows - -the expected number of windows to be displayedtimeOutInSeconds - - timeout in secondsWebDroneProperties getProperties()
WebDroneProperties propertiesvoid maximize()
long getDefaultWaitTime()
org.openqa.selenium.WebElement findFirstDisplayedElement(org.openqa.selenium.By selector)
List<org.openqa.selenium.WebElement> findDisplayedElements(org.openqa.selenium.By selector)
List of WebElementboolean isImageVisible(org.sikuli.api.Target target)
target - Target image we are looking for in the screen.org.openqa.selenium.WebElement find(org.sikuli.api.Target target)
WebElement by using an image.target - Target image to find byWebElement of the image.org.openqa.selenium.WebElement find(int x,
int y)
WebElement by x and y coordinates.x - horizontal coordinatesy - vertical coordinatesWebElement of coordinates.void sendkeys(org.openqa.selenium.Keys... keysToSend)
keysToSend - The Keysvoid clearAndType(org.openqa.selenium.By by,
String value)
Keys number.by - - To find the elementvalue - - Text to entered on text boxCopyright © 2014. All rights reserved.