Package org.xwiki.test.ui
Class XWikiWebDriver
- java.lang.Object
-
- org.openqa.selenium.remote.RemoteWebDriver
-
- org.xwiki.test.ui.XWikiWebDriver
-
- All Implemented Interfaces:
org.openqa.selenium.federatedcredentialmanagement.HasFederatedCredentialManagement,org.openqa.selenium.HasCapabilities,org.openqa.selenium.HasDownloads,org.openqa.selenium.interactions.Interactive,org.openqa.selenium.JavascriptExecutor,org.openqa.selenium.PrintsPage,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator,org.openqa.selenium.WebDriver
public class XWikiWebDriver extends org.openqa.selenium.remote.RemoteWebDriverWraps aWebDriverinstance and adds new APIs useful for XWiki tests.- Since:
- 7.0M2
- Version:
- $Id: ca017becc15a9f5f8bdf6f422b0db40a73acb202 $
-
-
Constructor Summary
Constructors Constructor Description XWikiWebDriver(org.openqa.selenium.remote.RemoteWebDriver wrappedDriver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPageNotYetReloadedMarker()Adds a marker in the DOM of the browser that will only be available until we leave or reload the current page.voidclose()org.openqa.selenium.interactions.ActionscreateActions()Utility method to build a proper instance ofActions.voiddragAndDrop(org.openqa.selenium.WebElement source, org.openqa.selenium.WebElement target)Utility method to perform a drag & drop by using the appropriate WebDriver.ObjectexecuteAsyncScript(String script, Object... args)ObjectexecuteJavascript(String javascript, Object... arguments)ObjectexecuteScript(String script, Object... args)org.openqa.selenium.WebElementfindElement(org.openqa.selenium.By by)OverwritesWebDriver.findElement(By)to make sure the found element is visible by scrolling it into view.List<org.openqa.selenium.WebElement>findElements(org.openqa.selenium.By by)List<org.openqa.selenium.WebElement>findElementsWithoutWaiting(org.openqa.selenium.By by)List<org.openqa.selenium.WebElement>findElementsWithoutWaiting(org.openqa.selenium.WebElement element, org.openqa.selenium.By by)org.openqa.selenium.WebElementfindElementWithoutScrolling(org.openqa.selenium.By by)Same asfindElement(By)but don't scroll to make the element visible.org.openqa.selenium.WebElementfindElementWithoutWaiting(org.openqa.selenium.By by)org.openqa.selenium.WebElementfindElementWithoutWaiting(org.openqa.selenium.WebElement element, org.openqa.selenium.By by)org.openqa.selenium.WebElementfindElementWithoutWaitingWithoutScrolling(org.openqa.selenium.By by)Same asfindElementWithoutWaiting(By)but don't scroll to make the element visible.voidget(String s)org.openqa.selenium.CapabilitiesgetCapabilities()org.openqa.selenium.remote.CommandExecutorgetCommandExecutor()StringgetCurrentUrl()org.openqa.selenium.remote.ErrorHandlergetErrorHandler()org.openqa.selenium.remote.FileDetectorgetFileDetector()StringgetPageSource()<X> XgetScreenshotAs(org.openqa.selenium.OutputType<X> outputType)org.openqa.selenium.remote.SessionIdgetSessionId()intgetTimeout()StringgetTitle()StringgetWindowHandle()Set<String>getWindowHandles()org.openqa.selenium.remote.RemoteWebDrivergetWrappedDriver()booleanhasElement(org.openqa.selenium.By by)Should be used when the result is supposed to be true (otherwise you'll incur the timeout and an error will be raised!).booleanhasElement(org.openqa.selenium.WebElement element, org.openqa.selenium.By by)Should be used when the result is supposed to be true (otherwise you'll incur the timeout).booleanhasElementWithoutWaiting(org.openqa.selenium.By by)booleanhasElementWithoutWaiting(org.openqa.selenium.WebElement element, org.openqa.selenium.By by)booleanhasElementWithoutWaitingWithoutScrolling(org.openqa.selenium.By by)Same ashasElementWithoutWaiting(By)but don't scroll to make the element visible.voidmakeAlertDialogSilent()voidmakeConfirmDialogSilent(boolean accept)There is no easy support for alert/confirm window methods yet, see - http://code.google.com/p/selenium/issues/detail?id=27 - http://www.google.com/codesearch/p?hl=en#2tHw6m3DZzo/branches /merge/common/test/java/org/openqa/selenium/AlertsTest.java The aim is :Alert alert = this.getDriver().switchTo().alert(); alert.accept();Until then, the following hack does override the confirm method in Javascript to return the given value.voidmakeElementVisible(org.openqa.selenium.By locator)Shows hidden elements, as if they would be shown on hover.voidmakeElementVisible(org.openqa.selenium.WebElement element)org.openqa.selenium.WebDriver.Optionsmanage()org.openqa.selenium.interactions.ActionsmoveToTopLeftCornerOfTargetWithOffset(org.openqa.selenium.WebElement target, int offsetX, int offsetY, org.openqa.selenium.interactions.Actions chainFrom)Same asActions.moveToElement(WebElement, int, int)except that the target is the top-left corner of the target, instead of the center.org.openqa.selenium.WebDriver.Navigationnavigate()voidquit()voidscrollTo(int xCoord, int yCoord)Instantaneously scrolls to the given coordinates inside the web page.org.openqa.selenium.WebElementscrollTo(org.openqa.selenium.WebElement element)voidsetDriverImplicitWait()Forces the driver to wait for agetTimeout()number of seconds when looking up page elements before declaring that it cannot find them.voidsetDriverImplicitWait(int timeout)Forces the driver to wait for passed number of seconds when looking up page elements before declaring that it cannot find them.voidsetErrorHandler(org.openqa.selenium.remote.ErrorHandler handler)voidsetFileDetector(org.openqa.selenium.remote.FileDetector detector)voidsetLogLevel(Level level)voidsetTextInputValue(org.openqa.selenium.WebElement textInputElement, String newTextValue)Compared to using clear() + sendKeys(), this method ensures that an "input" event is triggered on the JavaScript side for an empty ("") value.voidsetTimeout(int timeout)org.openqa.selenium.WebDriver.TargetLocatorswitchTo()StringtoString()<T> TwaitUntilCondition(org.openqa.selenium.support.ui.ExpectedCondition<T> condition)<T> TwaitUntilCondition(org.openqa.selenium.support.ui.ExpectedCondition<T> condition, int timeout)voidwaitUntilElementContainsAttributeValue(org.openqa.selenium.By locator, String attributeName, String expectedValue)Waits until the given element contain a certain value for an attribute.voidwaitUntilElementDisappears(org.openqa.selenium.By locator)Waits until the given locator corresponds to either a hidden or a deleted element.voidwaitUntilElementDisappears(org.openqa.selenium.WebElement parentElement, org.openqa.selenium.By locator)Waits until the given locator corresponds to either a hidden or a deleted element.voidwaitUntilElementEndsWithAttributeValue(org.openqa.selenium.By locator, String attributeName, String expectedValue)Waits until the given element ends with a certain value for an attribute.voidwaitUntilElementHasAttributeValue(org.openqa.selenium.By locator, String attributeName, String expectedValue)Waits until the given element has a certain value for an attribute.voidwaitUntilElementHasNonEmptyAttributeValue(org.openqa.selenium.By locator, String attributeName)Waits until the given element has a non-empty value for an attribute.voidwaitUntilElementHasTextContent(Supplier<org.openqa.selenium.WebElement> getElement, String expectedValue)Waits until the given element has a certain value as its inner text.voidwaitUntilElementHasTextContent(org.openqa.selenium.By locator, String expectedValue)Waits until the given element has a certain value as its inner text.voidwaitUntilElementIsDisabled(org.openqa.selenium.WebElement element)Waits until the given element is disabled.voidwaitUntilElementIsEnabled(org.openqa.selenium.WebElement element)Waits until the given element is enabled.voidwaitUntilElementIsVisible(org.openqa.selenium.By locator)Wait until the element given by the locator is displayed.voidwaitUntilElementIsVisible(org.openqa.selenium.By locator, int timeout)Wait until the element given by the locator is displayed.voidwaitUntilElementIsVisible(org.openqa.selenium.WebElement parentElement, org.openqa.selenium.By locator)Wait until the element specified by the locator is displayed.voidwaitUntilElementsAreVisible(org.openqa.selenium.By[] locators, boolean all)Wait until one or all of an array of element locators are displayed.voidwaitUntilElementsAreVisible(org.openqa.selenium.WebElement parentElement, org.openqa.selenium.By[] locators, boolean all)Wait until one or all of an array of element locators are displayed.voidwaitUntilJavascriptCondition(String booleanExpression, Object... arguments)Waits until the provided javascript expression returnstrue.voidwaitUntilPageIsReloaded()Waits until the previously added marker is no longer found on the current page, signaling that the page has been changed or reloaded.-
Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
addVirtualAuthenticator, builder, deleteDownloadableFiles, downloadFile, execute, execute, execute, findElements, getDownloadableFiles, getElementConverter, getExecuteMethod, getFederatedCredentialManagementDialog, log, perform, print, removeVirtualAuthenticator, resetCooldown, resetInputState, setCommandExecutor, setDelayEnabled, setElementConverter, setFoundBy, setSessionId, startSession
-
-
-
-
Method Detail
-
findElementWithoutWaiting
public org.openqa.selenium.WebElement findElementWithoutWaiting(org.openqa.selenium.By by)
-
findElementWithoutWaitingWithoutScrolling
public org.openqa.selenium.WebElement findElementWithoutWaitingWithoutScrolling(org.openqa.selenium.By by)
Same asfindElementWithoutWaiting(By)but don't scroll to make the element visible. Useful for example whenverifying that the page has finished loading (and thus there's no element visible and we cannot scroll to it).- Since:
- 10.8.1, 10.9
-
findElementsWithoutWaiting
public List<org.openqa.selenium.WebElement> findElementsWithoutWaiting(org.openqa.selenium.By by)
-
findElementWithoutWaiting
public org.openqa.selenium.WebElement findElementWithoutWaiting(org.openqa.selenium.WebElement element, org.openqa.selenium.By by)
-
findElementsWithoutWaiting
public List<org.openqa.selenium.WebElement> findElementsWithoutWaiting(org.openqa.selenium.WebElement element, org.openqa.selenium.By by)
-
hasElement
public boolean hasElement(org.openqa.selenium.By by)
Should be used when the result is supposed to be true (otherwise you'll incur the timeout and an error will be raised!).
-
hasElementWithoutWaiting
public boolean hasElementWithoutWaiting(org.openqa.selenium.By by)
-
hasElementWithoutWaitingWithoutScrolling
public boolean hasElementWithoutWaitingWithoutScrolling(org.openqa.selenium.By by)
Same ashasElementWithoutWaiting(By)but don't scroll to make the element visible. Useful for example whenverifying that the page has finished loading (and thus there's no element visible and we cannot scroll to it).- Since:
- 10.8.1, 10.9
-
hasElementWithoutWaiting
public boolean hasElementWithoutWaiting(org.openqa.selenium.WebElement element, org.openqa.selenium.By by)
-
hasElement
public boolean hasElement(org.openqa.selenium.WebElement element, org.openqa.selenium.By by)Should be used when the result is supposed to be true (otherwise you'll incur the timeout).
-
waitUntilCondition
public <T> T waitUntilCondition(org.openqa.selenium.support.ui.ExpectedCondition<T> condition, int timeout)
-
waitUntilCondition
public <T> T waitUntilCondition(org.openqa.selenium.support.ui.ExpectedCondition<T> condition)
-
setDriverImplicitWait
public void setDriverImplicitWait()
Forces the driver to wait for agetTimeout()number of seconds when looking up page elements before declaring that it cannot find them.
-
setDriverImplicitWait
public void setDriverImplicitWait(int timeout)
Forces the driver to wait for passed number of seconds when looking up page elements before declaring that it cannot find them.
-
getTimeout
public int getTimeout()
-
setTimeout
public void setTimeout(int timeout)
- Parameters:
timeout- the number of seconds after which we consider the action to have failed
-
waitUntilElementIsVisible
public void waitUntilElementIsVisible(org.openqa.selenium.By locator)
Wait until the element given by the locator is displayed. Give up after timeout seconds.- Parameters:
locator- the locator for the element to look for.
-
waitUntilElementIsVisible
public void waitUntilElementIsVisible(org.openqa.selenium.WebElement parentElement, org.openqa.selenium.By locator)Wait until the element specified by the locator is displayed. Give up after timeout seconds.- Parameters:
parentElement- where to look for the specified element,nullto look everywherelocator- the locator for the element to look for- Since:
- 7.2
-
waitUntilElementIsVisible
public void waitUntilElementIsVisible(org.openqa.selenium.By locator, int timeout)Wait until the element given by the locator is displayed. Give up after specified timeout (in seconds).Only use this API if you absolutely need a longer timeout than the default, otherwise use
waitUntilElementIsVisible(org.openqa.selenium.By).- Parameters:
locator- the locator for the element to look fortimeout- the timeout after which to give up- Since:
- 5.4RC1
-
waitUntilElementsAreVisible
public void waitUntilElementsAreVisible(org.openqa.selenium.By[] locators, boolean all)Wait until one or all of an array of element locators are displayed.- Parameters:
locators- the array of element locators to look forall- if true then don't return until all elements are found. Otherwise return after finding one
-
waitUntilElementsAreVisible
public void waitUntilElementsAreVisible(org.openqa.selenium.WebElement parentElement, org.openqa.selenium.By[] locators, boolean all)Wait until one or all of an array of element locators are displayed.- Parameters:
parentElement- where to look for the specified elements,nullto look everywherelocators- the array of element locators to look forall- if true then don't return until all elements are found. Otherwise return after finding one- Since:
- 7.2
-
waitUntilElementDisappears
public void waitUntilElementDisappears(org.openqa.selenium.By locator)
Waits until the given locator corresponds to either a hidden or a deleted element.- Parameters:
locator- the locator to wait for
-
waitUntilElementDisappears
public void waitUntilElementDisappears(org.openqa.selenium.WebElement parentElement, org.openqa.selenium.By locator)Waits until the given locator corresponds to either a hidden or a deleted element.- Parameters:
parentElement- the element from which to start the searchlocator- the locator to wait for
-
makeElementVisible
public void makeElementVisible(org.openqa.selenium.By locator)
Shows hidden elements, as if they would be shown on hover. Currently implemented using JavaScript. Will throw aRuntimeExceptionif the web driver does not support JavaScript or JavaScript is disabled.- Parameters:
locator- locator used to find the element, in case multiple elements are found, the first is used
-
makeElementVisible
public void makeElementVisible(org.openqa.selenium.WebElement element)
-
waitUntilElementHasNonEmptyAttributeValue
public void waitUntilElementHasNonEmptyAttributeValue(org.openqa.selenium.By locator, String attributeName)Waits until the given element has a non-empty value for an attribute.- Parameters:
locator- the element to wait onattributeName- the name of the attribute to check
-
waitUntilElementIsEnabled
public void waitUntilElementIsEnabled(org.openqa.selenium.WebElement element)
Waits until the given element is enabled.- Parameters:
element- the element to wait on- Since:
- 12.9RC1
-
waitUntilElementIsDisabled
public void waitUntilElementIsDisabled(org.openqa.selenium.WebElement element)
Waits until the given element is disabled.- Parameters:
element- the element to wait on- Since:
- 15.6RC1, 15.5.1, 14.10.15
-
waitUntilElementHasAttributeValue
public void waitUntilElementHasAttributeValue(org.openqa.selenium.By locator, String attributeName, String expectedValue)Waits until the given element has a certain value for an attribute.- Parameters:
locator- the element to wait onattributeName- the name of the attribute to checkexpectedValue- the attribute value to wait for
-
waitUntilElementEndsWithAttributeValue
public void waitUntilElementEndsWithAttributeValue(org.openqa.selenium.By locator, String attributeName, String expectedValue)Waits until the given element ends with a certain value for an attribute.- Parameters:
locator- the element to wait onattributeName- the name of the attribute to checkexpectedValue- the attribute value to wait for
-
waitUntilElementContainsAttributeValue
public void waitUntilElementContainsAttributeValue(org.openqa.selenium.By locator, String attributeName, String expectedValue)Waits until the given element contain a certain value for an attribute.- Parameters:
locator- the element to wait on.attributeName- the name of attribute to check.expectedValue- the value that should be contained in the attribute.- Since:
- 11.1RC1
-
waitUntilElementHasTextContent
public void waitUntilElementHasTextContent(org.openqa.selenium.By locator, String expectedValue)Waits until the given element has a certain value as its inner text.- Parameters:
locator- the element to wait onexpectedValue- the content value to wait for- Since:
- 3.2M3
-
waitUntilElementHasTextContent
public void waitUntilElementHasTextContent(Supplier<org.openqa.selenium.WebElement> getElement, String expectedValue)
Waits until the given element has a certain value as its inner text.- Parameters:
getElement- an arbitrary supplier for the element to wait on.WebElement.getText()is called on the returned value and compared to the expected valueexpectedValue- the content value to wait for- Since:
- 15.10RC1
-
makeConfirmDialogSilent
public void makeConfirmDialogSilent(boolean accept)
There is no easy support for alert/confirm window methods yet, see - http://code.google.com/p/selenium/issues/detail?id=27 - http://www.google.com/codesearch/p?hl=en#2tHw6m3DZzo/branches /merge/common/test/java/org/openqa/selenium/AlertsTest.java The aim is :Alert alert = this.getDriver().switchTo().alert(); alert.accept();Until then, the following hack does override the confirm method in Javascript to return the given value.- Parameters:
accept-trueto accept the confirmation dialog,falseto cancel it
-
makeAlertDialogSilent
public void makeAlertDialogSilent()
- Since:
- 3.2M3
- See Also:
makeConfirmDialogSilent(boolean)
-
waitUntilJavascriptCondition
public void waitUntilJavascriptCondition(String booleanExpression, Object... arguments) throws IllegalArgumentException
Waits until the provided javascript expression returnstrue.The wait is done while the expression returns
false.- Parameters:
booleanExpression- the javascript expression to wait for to returntrue. The expression must have areturnstatement on the last line, e.g."return window.jQuery != null"arguments- any arguments passed to the javascript expression- Throws:
IllegalArgumentException- if the evaluated expression does not return a boolean result- Since:
- 6.2
- See Also:
executeJavascript(String, Object...)
-
get
public void get(String s)
- Specified by:
getin interfaceorg.openqa.selenium.WebDriver- Overrides:
getin classorg.openqa.selenium.remote.RemoteWebDriver
-
getCurrentUrl
public String getCurrentUrl()
- Specified by:
getCurrentUrlin interfaceorg.openqa.selenium.WebDriver- Overrides:
getCurrentUrlin classorg.openqa.selenium.remote.RemoteWebDriver
-
getTitle
public String getTitle()
- Specified by:
getTitlein interfaceorg.openqa.selenium.WebDriver- Overrides:
getTitlein classorg.openqa.selenium.remote.RemoteWebDriver
-
findElements
public List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
- Specified by:
findElementsin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementsin interfaceorg.openqa.selenium.WebDriver- Overrides:
findElementsin classorg.openqa.selenium.remote.RemoteWebDriver
-
scrollTo
public org.openqa.selenium.WebElement scrollTo(org.openqa.selenium.WebElement element)
-
scrollTo
public void scrollTo(int xCoord, int yCoord)Instantaneously scrolls to the given coordinates inside the web page. If you want to scroll to a specificWebElement, seescrollTo(WebElement).- Parameters:
xCoord- is the pixel along the horizontal axis of the web page that you want displayed in the upper leftyCoord- is the pixel along the vertical axis of the web page that you want displayed in the upper left- Since:
- 13.3RC1, 12.10.7
- See Also:
- MDN Web Docs -
Element.scrollTo(),
scrollTo(WebElement)
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
OverwritesWebDriver.findElement(By)to make sure the found element is visible by scrolling it into view. This means that calling this method can have side effects on the User Interface. If the element you're looking for doesn't have to be visible in the viewport then you should usefindElementWithoutScrolling(By)instead.Also node that this method is called internally by APIs such as
ExpectedConditions#presenceOfElementLocated()so if you don't want the scrolling then you should implement your ownExpectedConditionusingfindElementWithoutScrolling(By).- Specified by:
findElementin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementin interfaceorg.openqa.selenium.WebDriver- Overrides:
findElementin classorg.openqa.selenium.remote.RemoteWebDriver
-
getPageSource
public String getPageSource()
- Specified by:
getPageSourcein interfaceorg.openqa.selenium.WebDriver- Overrides:
getPageSourcein classorg.openqa.selenium.remote.RemoteWebDriver
-
close
public void close()
- Specified by:
closein interfaceorg.openqa.selenium.WebDriver- Overrides:
closein classorg.openqa.selenium.remote.RemoteWebDriver
-
quit
public void quit()
- Specified by:
quitin interfaceorg.openqa.selenium.WebDriver- Overrides:
quitin classorg.openqa.selenium.remote.RemoteWebDriver
-
getWindowHandles
public Set<String> getWindowHandles()
- Specified by:
getWindowHandlesin interfaceorg.openqa.selenium.WebDriver- Overrides:
getWindowHandlesin classorg.openqa.selenium.remote.RemoteWebDriver
-
getWindowHandle
public String getWindowHandle()
- Specified by:
getWindowHandlein interfaceorg.openqa.selenium.WebDriver- Overrides:
getWindowHandlein classorg.openqa.selenium.remote.RemoteWebDriver
-
switchTo
public org.openqa.selenium.WebDriver.TargetLocator switchTo()
- Specified by:
switchToin interfaceorg.openqa.selenium.WebDriver- Overrides:
switchToin classorg.openqa.selenium.remote.RemoteWebDriver
-
navigate
public org.openqa.selenium.WebDriver.Navigation navigate()
- Specified by:
navigatein interfaceorg.openqa.selenium.WebDriver- Overrides:
navigatein classorg.openqa.selenium.remote.RemoteWebDriver
-
manage
public org.openqa.selenium.WebDriver.Options manage()
- Specified by:
managein interfaceorg.openqa.selenium.WebDriver- Overrides:
managein classorg.openqa.selenium.remote.RemoteWebDriver
-
setFileDetector
public void setFileDetector(org.openqa.selenium.remote.FileDetector detector)
- Overrides:
setFileDetectorin classorg.openqa.selenium.remote.RemoteWebDriver
-
getSessionId
public org.openqa.selenium.remote.SessionId getSessionId()
- Overrides:
getSessionIdin classorg.openqa.selenium.remote.RemoteWebDriver
-
getErrorHandler
public org.openqa.selenium.remote.ErrorHandler getErrorHandler()
- Overrides:
getErrorHandlerin classorg.openqa.selenium.remote.RemoteWebDriver
-
setErrorHandler
public void setErrorHandler(org.openqa.selenium.remote.ErrorHandler handler)
- Overrides:
setErrorHandlerin classorg.openqa.selenium.remote.RemoteWebDriver
-
getCommandExecutor
public org.openqa.selenium.remote.CommandExecutor getCommandExecutor()
- Overrides:
getCommandExecutorin classorg.openqa.selenium.remote.RemoteWebDriver
-
getCapabilities
public org.openqa.selenium.Capabilities getCapabilities()
- Specified by:
getCapabilitiesin interfaceorg.openqa.selenium.HasCapabilities- Overrides:
getCapabilitiesin classorg.openqa.selenium.remote.RemoteWebDriver
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> outputType) throws org.openqa.selenium.WebDriverException- Specified by:
getScreenshotAsin interfaceorg.openqa.selenium.TakesScreenshot- Overrides:
getScreenshotAsin classorg.openqa.selenium.remote.RemoteWebDriver- Throws:
org.openqa.selenium.WebDriverException
-
executeScript
public Object executeScript(String script, Object... args)
- Specified by:
executeScriptin interfaceorg.openqa.selenium.JavascriptExecutor- Overrides:
executeScriptin classorg.openqa.selenium.remote.RemoteWebDriver
-
executeAsyncScript
public Object executeAsyncScript(String script, Object... args)
- Specified by:
executeAsyncScriptin interfaceorg.openqa.selenium.JavascriptExecutor- Overrides:
executeAsyncScriptin classorg.openqa.selenium.remote.RemoteWebDriver
-
setLogLevel
public void setLogLevel(Level level)
- Overrides:
setLogLevelin classorg.openqa.selenium.remote.RemoteWebDriver
-
getFileDetector
public org.openqa.selenium.remote.FileDetector getFileDetector()
- Overrides:
getFileDetectorin classorg.openqa.selenium.remote.RemoteWebDriver
-
toString
public String toString()
- Overrides:
toStringin classorg.openqa.selenium.remote.RemoteWebDriver
-
setTextInputValue
public void setTextInputValue(org.openqa.selenium.WebElement textInputElement, String newTextValue)Compared to using clear() + sendKeys(), this method ensures that an "input" event is triggered on the JavaScript side for an empty ("") value. Without this, the clear() method triggers just a "change" event.- Parameters:
textInputElement- an element accepting text inputnewTextValue- the new text value to set- Since:
- 7.2M3
- See Also:
- Issue 214
-
addPageNotYetReloadedMarker
public void addPageNotYetReloadedMarker()
Adds a marker in the DOM of the browser that will only be available until we leave or reload the current page.To be used mainly before
waitUntilPageIsReloaded().- Since:
- 7.4M2
-
waitUntilPageIsReloaded
public void waitUntilPageIsReloaded()
Waits until the previously added marker is no longer found on the current page, signaling that the page has been changed or reloaded. Useful when the page loading is done by jJavaScript and Selenium can not help in telling us when we have left the old page.To be used always after
addPageNotYetReloadedMarker().- Since:
- 7.4M2
-
findElementWithoutScrolling
public org.openqa.selenium.WebElement findElementWithoutScrolling(org.openqa.selenium.By by)
Same asfindElement(By)but don't scroll to make the element visible. Useful for example when verifying that the page has finished loading (and thus there's no element visible and we cannot scroll to it).- Since:
- 10.8.1, 10.9
-
getWrappedDriver
public org.openqa.selenium.remote.RemoteWebDriver getWrappedDriver()
- Returns:
- the original
RemoteWebDrivercreated for selenium tests. The original driver should be used for customActions. - Since:
- 11.3RC1
-
dragAndDrop
public void dragAndDrop(org.openqa.selenium.WebElement source, org.openqa.selenium.WebElement target)Utility method to perform a drag & drop by using the appropriate WebDriver.- Parameters:
source- the element to dragtarget- the element where to drop- Since:
- 11.3RC1
-
createActions
public org.openqa.selenium.interactions.Actions createActions()
Utility method to build a proper instance ofActions.- Returns:
- a new instance of
Actions. - Since:
- 11.9RC1
-
moveToTopLeftCornerOfTargetWithOffset
public org.openqa.selenium.interactions.Actions moveToTopLeftCornerOfTargetWithOffset(org.openqa.selenium.WebElement target, int offsetX, int offsetY, org.openqa.selenium.interactions.Actions chainFrom)Same asActions.moveToElement(WebElement, int, int)except that the target is the top-left corner of the target, instead of the center.- Parameters:
target- the element for which we want to reach the offset from the top-left corner.offsetX- the offset on the right of the top-left corner to move tooffsetY- the offset on the bottom of the top-left corner to move tochainFrom- the existing actions to be chain to, or null to create a dedicated chain of actions.- Returns:
- an actions with the right move.
- Since:
- 11.9RC1
-
-