Package org.alfresco.utility.web.browser
Class WebBrowser
java.lang.Object
org.alfresco.utility.web.browser.WebBrowser
A wrapper around an arbitrary WebDriver instance which supports registering
of a
WebDriverListener for logging purposes.- Author:
- Paul.Brodner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.openqa.selenium.WebDriverprotected static final org.slf4j.Loggerprotected TasProperties -
Constructor Summary
ConstructorsConstructorDescriptionWebBrowser(org.openqa.selenium.WebDriver driver) WebBrowser(org.openqa.selenium.WebDriver baseDriver, TasProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionauthenticatedSession(org.apache.commons.httpclient.HttpState httpState) Inject auth cookie in current session so you don't need to login with LoginPagevoidThis is working in combination withauthenticatedSession(HttpState)voidclickJS(org.openqa.selenium.WebElement elementToClick) ClickWebElementwith JavaScript commandvoidCloses the window opened leaving the browser session openedvoidCloses the newly created win and swithes back to mainvoidcloseWindowAndSwitchBackParametrized(String windowToSwitchTo, String windowToClose) Closes the window and returns to selected windowvoiddeleteCookie(org.openqa.selenium.Cookie cookie) Delete cookie based on given cookie.voidFunction to delete the cookies in the browservoiddoubleClickOnElement(org.openqa.selenium.WebElement element) Double click on an elementvoiddragAndDrop(org.openqa.selenium.WebElement source, int x, int y) Drag web element by x,y coordinatesvoiddragAndDrop(org.openqa.selenium.WebElement source, org.openqa.selenium.WebElement target) Drag the source element and drop into target element.voidexecuteJavaScript(String command) Execute Javascript commandvoidexecuteJavaScript(String command, org.openqa.selenium.WebElement element) Execute Javascript command withWebElementList<org.openqa.selenium.WebElement>findDisplayedElementsFromLocator(org.openqa.selenium.By selector) This function will return list of visible elements found with the specified selectororg.openqa.selenium.WebElementfindElement(org.openqa.selenium.By by) List<org.openqa.selenium.WebElement>findElements(org.openqa.selenium.By by) org.openqa.selenium.WebElementfindFirstDisplayedElement(org.openqa.selenium.By locator) This function will return 1st visible element found with the specified selectororg.openqa.selenium.WebElementfindFirstElementWithExactValue(List<org.openqa.selenium.WebElement> list, String value) This function will return 1st element found with the exact specified valueorg.openqa.selenium.WebElementfindFirstElementWithValue(List<org.openqa.selenium.WebElement> list, String value) This function will return 1st element found which contains a specified valueorg.openqa.selenium.WebElementfindFirstElementWithValue(org.openqa.selenium.By locator, String value) This function will return 1st element found with a specified valuevoidfocusOnWebElement(org.openqa.selenium.WebElement webElement) voidorg.openqa.selenium.CookieGet a cookie that matches the name.org.openqa.selenium.WebDriverGets the URL of the previously visited page.getTextFromElementList(List<org.openqa.selenium.WebElement> elementsList) getTextFromLocatorList(org.openqa.selenium.By elementsList) voidvoidbooleanbooleanisElementDisplayed(org.openqa.selenium.By locator) Returns true if the element is displayed else false.booleanisElementDisplayed(org.openqa.selenium.WebElement element) Returns true if the element is displayed else false.booleanisElementDisplayed(org.openqa.selenium.WebElement element, org.openqa.selenium.By locator) Returns true if the element is displayed else false.booleanisOptionSelectedForFilter(String option, org.openqa.selenium.WebElement filterElement) voidmaximize()Maximizes the current window if it is not already maximizedvoidmouseOver(org.openqa.selenium.WebElement element) Recreating the action of hovering over a particular HTML element on a page.voidmouseOver(org.openqa.selenium.WebElement element, int xOffset, int yOffset) Recreating the action of hovering over with offset coordinates a particular HTML element on a page.voidmouseOverViaJavascript(org.openqa.selenium.WebElement webElement) Method to perform mouse over to a given web element, using JavaScriptorg.openqa.selenium.WebDriver.Navigationnavigate()voidquit()voidrefresh()Acts as a refresh page action similar to F5 key.voidrightClickOnElement(org.openqa.selenium.WebElement element) Right click on an elementvoidscrollIntoView(org.openqa.selenium.WebElement element) Scroll to WebElementvoidscrollToElement(org.openqa.selenium.WebElement element) Scroll to WebElementvoidselectOptionFromFilterOptionsList(String option, List<org.openqa.selenium.WebElement> filterOptionsList) This function selects specified filter option from filter options listorg.openqa.selenium.WebDriver.TargetLocatorswitchTo()voidMethod to switch back from i-frame to default content.voidswitchToFrame(String frameId) Method to switch on to frames of content object.voidswitchToWindow(String windowHandle) This method transfers the control to the specific window as per the given window handle.voidSwitches to the newly created window.voidswitchWindow(int windowIndex) Waits and switches to window based on indexvoidswitchWindow(String winHandler) Switches to window with specified url.voidwaitInSeconds(int seconds) Method to wait for given seconds.org.openqa.selenium.WebElementwaitUntilChildElementIsPresent(org.openqa.selenium.By parentLocator, org.openqa.selenium.By childLocator) Wait for child WebElement as a part of parent element to presentorg.openqa.selenium.WebElementwaitUntilChildElementIsPresent(org.openqa.selenium.By parentLocator, org.openqa.selenium.By childLocator, long timeOutInSeconds) Wait for child WebElement as a part of parent element to presentorg.openqa.selenium.WebElementwaitUntilChildElementIsPresent(org.openqa.selenium.WebElement parentLocator, org.openqa.selenium.By childLocator) Wait for child WebElement as a part of parent element to presentorg.openqa.selenium.WebElementwaitUntilChildElementIsPresent(org.openqa.selenium.WebElement parentLocator, org.openqa.selenium.By childLocator, long timeOutInSeconds) Wait for child WebElement as a part of parent element to presentorg.openqa.selenium.WebElementwaitUntilElementClickable(org.openqa.selenium.By locator) org.openqa.selenium.WebElementwaitUntilElementClickable(org.openqa.selenium.By locator, long timeOutInSeconds) Wait until the Clickable of given Element for given seconds.org.openqa.selenium.WebElementwaitUntilElementClickable(org.openqa.selenium.WebElement element) Wait until the Clickable of given Element for given seconds.org.openqa.selenium.WebElementwaitUntilElementClickable(org.openqa.selenium.WebElement element, long timeOutInSeconds) Wait until the Clickable of given Element for given seconds.voidwaitUntilElementContainsText(org.openqa.selenium.By locator, String text) Wait until the given text is present in the given LocatorvoidwaitUntilElementContainsText(org.openqa.selenium.WebElement element, String text) Wait until the given text is present in the given ElementvoidwaitUntilElementDeletedFromDom(org.openqa.selenium.By locator) Wait Until element successfully deleting from DOM.voidwaitUntilElementDeletedFromDom(org.openqa.selenium.By locator, long timeOutInSeconds) Wait Until element successfully deleting from DOM.voidwaitUntilElementDisappears(org.openqa.selenium.By locator) Wait until the invisibility of given Element for given seconds.voidwaitUntilElementDisappears(org.openqa.selenium.By locator, long timeOutInSeconds) Wait until the invisibility of given Element for given seconds.voidwaitUntilElementDisappears(org.openqa.selenium.WebElement locator) Wait until the invisibility of given Element for given seconds.voidwaitUntilElementDisappears(org.openqa.selenium.WebElement locator, long timeOutInSeconds) Wait until the invisibility of given Element for given seconds.voidwaitUntilElementDisappearsWithRetry(org.openqa.selenium.By locator, int secondsToWait) Wait the element to disappear by refreshing the pagevoidwaitUntilElementDoesNotContainText(org.openqa.selenium.WebElement element, String text) Wait until the given text is not present in the given ElementvoidwaitUntilElementHasAttribute(org.openqa.selenium.By locator, String attribute, String value) voidwaitUntilElementHasAttribute(org.openqa.selenium.WebElement element, String attribute, String value) Wait until the element has attribute for the specified amount of time.voidwaitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator) Wait the element is displayed by refreshing the pagevoidwaitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator, int secondsToWait) Wait the element is displayed by refreshing the pagevoidwaitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator, int secondsToWait, int retryTimes) Wait the element is displayed by refreshing the pagevoidwaitUntilElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement, int secondsToWait) Wait the element is displayed by refreshing the pageorg.openqa.selenium.WebElementwaitUntilElementIsPresent(org.openqa.selenium.By locator) Wait until element is present on the DOM of a page.org.openqa.selenium.WebElementwaitUntilElementIsPresent(org.openqa.selenium.By locator, long timeOutInSeconds) Wait until element is present on the DOM of a page.voidwaitUntilElementIsVisibleWithRetry(org.openqa.selenium.By locator, int retryCount) Wait until element is visible with retryList<org.openqa.selenium.WebElement>waitUntilElementsVisible(List<org.openqa.selenium.WebElement> elements) Helper method to find and return a slow loading collection ofWebElement.List<org.openqa.selenium.WebElement>waitUntilElementsVisible(org.openqa.selenium.By locator) Helper method to find and return a slow loading collection ofWebElement.org.openqa.selenium.WebElementwaitUntilElementVisible(org.openqa.selenium.By locator) Wait until the element is visible for the specified amount of time.org.openqa.selenium.WebElementwaitUntilElementVisible(org.openqa.selenium.By locator, long timeOutInSeconds) Wait until the element is visible for the specified amount of time.org.openqa.selenium.WebElementwaitUntilElementVisible(org.openqa.selenium.WebElement element) Wait until the element is visible for the specified amount of time.org.openqa.selenium.WebElementwaitUntilElementVisible(org.openqa.selenium.WebElement element, long timeOutInSeconds) Wait until the element is visible for the specified amount of time.voidwaitUntilWebElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement) Wait until one element is displayed by refreshing the pagevoidwaitUntilWebElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement, int secondsToWait) Wait until one element is displayed by refreshing the pagevoidwaitUrlContains(String URLfraction, long timeOutInSeconds) Wait until url contains the given URL fraction.org.openqa.selenium.WebElementwaitWithRetryAndReturnWebElement(org.openqa.selenium.By locator, int secondsToWait, int retryTimes)
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
properties
-
driver
protected final org.openqa.selenium.WebDriver driver
-
-
Constructor Details
-
WebBrowser
-
WebBrowser
public WebBrowser(org.openqa.selenium.WebDriver driver)
-
-
Method Details
-
authenticatedSession
Inject auth cookie in current session so you don't need to login with LoginPage -
cleanUpAuthenticatedSession
public void cleanUpAuthenticatedSession()This is working in combination withauthenticatedSession(HttpState) -
mouseOver
public void mouseOver(org.openqa.selenium.WebElement element) Recreating the action of hovering over a particular HTML element on a page.- Parameters:
element-WebElementtarget
-
mouseOver
public void mouseOver(org.openqa.selenium.WebElement element, int xOffset, int yOffset) Recreating the action of hovering over with offset coordinates a particular HTML element on a page.- Parameters:
element-WebElementtarget
-
mouseOverViaJavascript
public void mouseOverViaJavascript(org.openqa.selenium.WebElement webElement) Method to perform mouse over to a given web element, using JavaScript- Parameters:
webElement- web element which will take the mouse over event
-
refresh
public void refresh()Acts as a refresh page action similar to F5 key. -
waitUntilElementHasAttribute
public void waitUntilElementHasAttribute(org.openqa.selenium.WebElement element, String attribute, String value) Wait until the element has attribute for the specified amount of time.- Parameters:
element-
-
waitUntilElementHasAttribute
-
waitUntilElementVisible
public org.openqa.selenium.WebElement waitUntilElementVisible(org.openqa.selenium.By locator) Wait until the element is visible for the specified amount of time.- Parameters:
locator-Bylocator
-
waitUntilElementVisible
public org.openqa.selenium.WebElement waitUntilElementVisible(org.openqa.selenium.By locator, long timeOutInSeconds) Wait until the element is visible for the specified amount of time.- Parameters:
locator-BylocatortimeOutInSeconds- timeout in seconds
-
waitUntilElementIsPresent
public org.openqa.selenium.WebElement waitUntilElementIsPresent(org.openqa.selenium.By locator, long timeOutInSeconds) Wait until element is present on the DOM of a page.- Parameters:
locator-BylocatortimeOutInSeconds- seconds to wait- Returns:
WebElement
-
waitUntilElementIsPresent
public org.openqa.selenium.WebElement waitUntilElementIsPresent(org.openqa.selenium.By locator) Wait until element is present on the DOM of a page.- Parameters:
locator-Bylocator- Returns:
WebElement
-
waitUntilChildElementIsPresent
public org.openqa.selenium.WebElement waitUntilChildElementIsPresent(org.openqa.selenium.By parentLocator, org.openqa.selenium.By childLocator, long timeOutInSeconds) Wait for child WebElement as a part of parent element to present- Parameters:
parentLocator-Byparent locatorchildLocator-Bychild locatortimeOutInSeconds- seconds to wait- Returns:
WebElement
-
waitUntilChildElementIsPresent
public org.openqa.selenium.WebElement waitUntilChildElementIsPresent(org.openqa.selenium.By parentLocator, org.openqa.selenium.By childLocator) Wait for child WebElement as a part of parent element to present- Parameters:
parentLocator-Byparent locatorchildLocator-Bychild locator- Returns:
WebElement
-
waitUntilChildElementIsPresent
public org.openqa.selenium.WebElement waitUntilChildElementIsPresent(org.openqa.selenium.WebElement parentLocator, org.openqa.selenium.By childLocator, long timeOutInSeconds) Wait for child WebElement as a part of parent element to present- Parameters:
parentLocator-WebElementparent locatorchildLocator-Bychild locatortimeOutInSeconds- seconds to wait- Returns:
WebElement
-
waitUntilChildElementIsPresent
public org.openqa.selenium.WebElement waitUntilChildElementIsPresent(org.openqa.selenium.WebElement parentLocator, org.openqa.selenium.By childLocator) Wait for child WebElement as a part of parent element to present- Parameters:
parentLocator-WebElementparent locatorchildLocator-Bychild locator- Returns:
WebElement
-
waitUntilElementVisible
public org.openqa.selenium.WebElement waitUntilElementVisible(org.openqa.selenium.WebElement element) Wait until the element is visible for the specified amount of time.- Parameters:
element-WebElementweb element
-
waitUntilElementVisible
public org.openqa.selenium.WebElement waitUntilElementVisible(org.openqa.selenium.WebElement element, long timeOutInSeconds) Wait until the element is visible for the specified amount of time.- Parameters:
element-WebElementweb elementtimeOutInSeconds- timeout in seconds
-
waitUntilElementsVisible
public List<org.openqa.selenium.WebElement> waitUntilElementsVisible(org.openqa.selenium.By locator) Helper method to find and return a slow loading collection ofWebElement.- Parameters:
locator-Bysearch criteria- Returns:
- Collection of
WebElementHTML elements
-
waitUntilElementsVisible
public List<org.openqa.selenium.WebElement> waitUntilElementsVisible(List<org.openqa.selenium.WebElement> elements) Helper method to find and return a slow loading collection ofWebElement.- Parameters:
elements-WebElementsearch criteria- Returns:
- Collection of
WebElementHTML elements
-
waitUntilElementIsDisplayedWithRetry
public void waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator) Wait the element is displayed by refreshing the page- Parameters:
locator-Byquery
-
waitUntilElementIsDisplayedWithRetry
public void waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator, int secondsToWait) Wait the element is displayed by refreshing the page- Parameters:
locator-ByquerysecondsToWait-
-
waitUntilElementIsDisplayedWithRetry
public void waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator, int secondsToWait, int retryTimes) Wait the element is displayed by refreshing the page- Parameters:
locator-ByquerysecondsToWait-retryTimes-
-
waitWithRetryAndReturnWebElement
public org.openqa.selenium.WebElement waitWithRetryAndReturnWebElement(org.openqa.selenium.By locator, int secondsToWait, int retryTimes) -
waitUntilElementIsDisplayedWithRetry
public void waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement, int secondsToWait) Wait the element is displayed by refreshing the page- Parameters:
webElement-WebElementquerysecondsToWait-
-
waitUntilElementDisappearsWithRetry
public void waitUntilElementDisappearsWithRetry(org.openqa.selenium.By locator, int secondsToWait) Wait the element to disappear by refreshing the page- Parameters:
locator-ByquerysecondsToWait-
-
waitUntilWebElementIsDisplayedWithRetry
public void waitUntilWebElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement) Wait until one element is displayed by refreshing the page- Parameters:
webElement-
-
waitUntilWebElementIsDisplayedWithRetry
public void waitUntilWebElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement, int secondsToWait) Wait until one element is displayed by refreshing the page- Parameters:
webElement-secondsToWait-
-
waitUntilElementClickable
public org.openqa.selenium.WebElement waitUntilElementClickable(org.openqa.selenium.WebElement element) Wait until the Clickable of given Element for given seconds.- Parameters:
element- WebElement
-
waitUntilElementClickable
public org.openqa.selenium.WebElement waitUntilElementClickable(org.openqa.selenium.By locator) -
waitUntilElementClickable
public org.openqa.selenium.WebElement waitUntilElementClickable(org.openqa.selenium.By locator, long timeOutInSeconds) Wait until the Clickable of given Element for given seconds.- Parameters:
locator- CSS LocatortimeOutInSeconds- Timeout In Seconds
-
waitUntilElementClickable
public org.openqa.selenium.WebElement waitUntilElementClickable(org.openqa.selenium.WebElement element, long timeOutInSeconds) Wait until the Clickable of given Element for given seconds.- Parameters:
element- WebElementtimeOutInSeconds- Timeout In Seconds
-
waitUntilElementContainsText
Wait until the given text is present in the given Element- Parameters:
element- WebElement
-
waitUntilElementContainsText
Wait until the given text is present in the given Locator- Parameters:
locator- Locator
-
waitUrlContains
Wait until url contains the given URL fraction.- Parameters:
URLfraction-timeOutInSeconds-
-
waitUntilElementDeletedFromDom
public void waitUntilElementDeletedFromDom(org.openqa.selenium.By locator) Wait Until element successfully deleting from DOM.- Parameters:
locator-Bylocator
-
waitUntilElementDeletedFromDom
public void waitUntilElementDeletedFromDom(org.openqa.selenium.By locator, long timeOutInSeconds) Wait Until element successfully deleting from DOM.- Parameters:
locator-BylocatortimeOutInSeconds- time to wait
-
waitUntilElementDisappears
public void waitUntilElementDisappears(org.openqa.selenium.By locator) Wait until the invisibility of given Element for given seconds.- Parameters:
locator- CSS Locator
-
waitUntilElementDisappears
public void waitUntilElementDisappears(org.openqa.selenium.By locator, long timeOutInSeconds) Wait until the invisibility of given Element for given seconds.- Parameters:
locator-ByLocatortimeOutInSeconds- timeout In Seconds
-
waitUntilElementDisappears
public void waitUntilElementDisappears(org.openqa.selenium.WebElement locator, long timeOutInSeconds) Wait until the invisibility of given Element for given seconds.- Parameters:
locator-ByLocatortimeOutInSeconds- timeout In Seconds
-
waitUntilElementDisappears
public void waitUntilElementDisappears(org.openqa.selenium.WebElement locator) Wait until the invisibility of given Element for given seconds.- Parameters:
locator- CSS Locator
-
isElementDisplayed
public boolean isElementDisplayed(org.openqa.selenium.By locator) Returns true if the element is displayed else false.- Parameters:
locator-Byquery- Returns:
- boolean true if displayed
-
isElementDisplayed
public boolean isElementDisplayed(org.openqa.selenium.WebElement element) Returns true if the element is displayed else false.- Parameters:
element-Byquery- Returns:
- boolean true if displayed
-
isElementDisplayed
public boolean isElementDisplayed(org.openqa.selenium.WebElement element, org.openqa.selenium.By locator) Returns true if the element is displayed else false.- Parameters:
locator-WebElementqueryByquery- Returns:
- boolean true if displayed
-
getPreviousUrl
Gets the URL of the previously visited page. The previous url is only displayed once interacted with the page. If user uses drone.navigetTo it will treat it as an entry page and will not have a previous page url.- Returns:
- String previous page URL
-
switchToFrame
Method to switch on to frames of content object.- Parameters:
frameId- String identifier
-
switchToDefaultContent
public void switchToDefaultContent()Method to switch back from i-frame to default content. -
switchWindow
public void switchWindow()Switches to the newly created window. -
switchWindow
public void switchWindow(int windowIndex) Waits and switches to window based on index -
switchWindow
Switches to window with specified url. -
closeWindowAndSwitchBack
public void closeWindowAndSwitchBack()Closes the newly created win and swithes back to main -
closeWindowAndSwitchBackParametrized
Closes the window and returns to selected window -
closeWindowAcceptingModalDialog
public void closeWindowAcceptingModalDialog()Closes the window opened leaving the browser session opened -
switchToWindow
This method transfers the control to the specific window as per the given window handle.- Parameters:
windowHandle- identifier
-
getCookie
Get a cookie that matches the name.- Parameters:
name- String cookie identifier- Returns:
- Cookie object
-
deleteCookies
public void deleteCookies()Function to delete the cookies in the browser -
deleteCookie
public void deleteCookie(org.openqa.selenium.Cookie cookie) Delete cookie based on given cookie.- Parameters:
cookie-Cookieobject to be deleted.
-
maximize
public void maximize()Maximizes the current window if it is not already maximized -
dragAndDrop
public void dragAndDrop(org.openqa.selenium.WebElement source, org.openqa.selenium.WebElement target) Drag the source element and drop into target element.- Parameters:
source- SourceWebElementtarget- TargetWebElement
-
dragAndDrop
public void dragAndDrop(org.openqa.selenium.WebElement source, int x, int y) Drag web element by x,y coordinates- Parameters:
source- htmlWebElementx- coordinatey- coordinate
-
doubleClickOnElement
public void doubleClickOnElement(org.openqa.selenium.WebElement element) Double click on an element- Parameters:
element-WebElement
-
rightClickOnElement
public void rightClickOnElement(org.openqa.selenium.WebElement element) Right click on an element- Parameters:
element-WebElement
-
findFirstDisplayedElement
public org.openqa.selenium.WebElement findFirstDisplayedElement(org.openqa.selenium.By locator) This function will return 1st visible element found with the specified selector- Parameters:
locator-Byselector type- Returns:
WebElementelement to interact
-
findFirstElementWithValue
public org.openqa.selenium.WebElement findFirstElementWithValue(org.openqa.selenium.By locator, String value) This function will return 1st element found with a specified value- Parameters:
locator-Byidentifier- Returns:
ListofWebElement
-
findFirstElementWithValue
public org.openqa.selenium.WebElement findFirstElementWithValue(List<org.openqa.selenium.WebElement> list, String value) This function will return 1st element found which contains a specified value -
findFirstElementWithExactValue
public org.openqa.selenium.WebElement findFirstElementWithExactValue(List<org.openqa.selenium.WebElement> list, String value) This function will return 1st element found with the exact specified value- Parameters:
list-value-- Returns:
-
findDisplayedElementsFromLocator
public List<org.openqa.selenium.WebElement> findDisplayedElementsFromLocator(org.openqa.selenium.By selector) This function will return list of visible elements found with the specified selector- Parameters:
selector-Byidentifier- Returns:
ListofWebElement
-
selectOptionFromFilterOptionsList
public void selectOptionFromFilterOptionsList(String option, List<org.openqa.selenium.WebElement> filterOptionsList) This function selects specified filter option from filter options list- Parameters:
option- Option to be selectedfilterOptionsList- The filter Option List
-
isOptionSelectedForFilter
public boolean isOptionSelectedForFilter(String option, org.openqa.selenium.WebElement filterElement) -
scrollToElement
public void scrollToElement(org.openqa.selenium.WebElement element) Scroll to WebElement- Parameters:
element- WebElement
-
scrollIntoView
public void scrollIntoView(org.openqa.selenium.WebElement element) Scroll to WebElement- Parameters:
element- WebElement
-
waitInSeconds
public void waitInSeconds(int seconds) Method to wait for given seconds.- Parameters:
seconds- time in seconds
-
executeJavaScript
Execute Javascript command- Parameters:
command-
-
executeJavaScript
Execute Javascript command withWebElement- Parameters:
command-element-WebElement
-
clickJS
public void clickJS(org.openqa.selenium.WebElement elementToClick) ClickWebElementwith JavaScript command- Parameters:
elementToClick-
-
isAlertPresent
public boolean isAlertPresent() -
handleModalDialogAcceptingAlert
public void handleModalDialogAcceptingAlert() -
handleModalDialogDismissingAlert
public void handleModalDialogDismissingAlert() -
focusOnWebElement
public void focusOnWebElement(org.openqa.selenium.WebElement webElement) -
waitUntilElementIsVisibleWithRetry
public void waitUntilElementIsVisibleWithRetry(org.openqa.selenium.By locator, int retryCount) Wait until element is visible with retry- Parameters:
locator-retryCount-
-
waitUntilElementDoesNotContainText
Wait until the given text is not present in the given Element- Parameters:
element- WebElement
-
getTextFromLocatorList
-
getTextFromElementList
-
getDriver
public org.openqa.selenium.WebDriver getDriver() -
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by) -
findElements
-
switchTo
public org.openqa.selenium.WebDriver.TargetLocator switchTo() -
getCurrentUrl
-
get
-
quit
public void quit()
-