Package io.fluentlenium.core.hook
Class BaseHook<T>
java.lang.Object
io.fluentlenium.core.FluentControlImpl
io.fluentlenium.core.DefaultFluentContainer
io.fluentlenium.core.hook.BaseHook<T>
- Type Parameters:
T- type of options for the hook
- All Implemented Interfaces:
Configuration,ConfigurationMutator,ConfigurationProperties,InputControl,AlertControl,CapabilitiesControl,ComponentInstantiator,CssControl,EventsControl,FluentContainer,FluentControl,FluentHook<T>,FluentInjectControl,NavigationControl,PerformanceTimingControl,JavascriptControl,SearchControl<FluentWebElement>,SeleniumDriverControl,SnapshotControl,AwaitControl,ChromiumControl,org.openqa.selenium.interactions.Locatable,org.openqa.selenium.SearchContext,org.openqa.selenium.support.pagefactory.ElementLocator,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement,org.openqa.selenium.WrapsElement
- Direct Known Subclasses:
BaseFluentHook
Base hook implementation.
You should extends this class to implement your own hook.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.fluentlenium.configuration.ConfigurationProperties
ConfigurationProperties.DriverLifecycle, ConfigurationProperties.TriggerMode -
Field Summary
Fields inherited from class io.fluentlenium.core.DefaultFluentContainer
control -
Constructor Summary
ConstructorsConstructorDescriptionBaseHook(FluentControl control, ComponentInstantiator instantiator, Supplier<org.openqa.selenium.WebElement> elementSupplier, Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locatorSupplier, Supplier<String> toStringSupplier, T options) Creates a new base hook. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidclick()org.openqa.selenium.WebElementorg.openqa.selenium.WebElementfindElement(org.openqa.selenium.By by) List<org.openqa.selenium.WebElement>List<org.openqa.selenium.WebElement>findElements(org.openqa.selenium.By by) getAttribute(String name) org.openqa.selenium.interactions.CoordinatesGet coordinates of the underlying element.getCssValue(String propertyName) final org.openqa.selenium.WebElementGet the underlying element of the hook.final org.openqa.selenium.support.pagefactory.ElementLocatorGet the underlying element locator of the hook.Get the component instantiator.org.openqa.selenium.PointGet the options of the hook.org.openqa.selenium.RectanglegetRect()<X> XgetScreenshotAs(org.openqa.selenium.OutputType<X> outputType) org.openqa.selenium.DimensiongetSize()getText()org.openqa.selenium.WebElementbooleanbooleanbooleanprotected TBuilds default options.voidsendKeys(CharSequence... charSequences) voidsubmit()toString()Methods inherited from class io.fluentlenium.core.DefaultFluentContainer
getDriver, getFluentControl, initFluentMethods inherited from class io.fluentlenium.core.FluentControlImpl
getConfiguration, getControlContainerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.fluentlenium.core.FluentControl
alert, asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, await, canTakeScreenShot, capabilities, css, el, events, executeAsyncScript, executeScript, find, find, find, find, getAppiumDriver, getAwaitAtMost, getAwaitPollingEvery, getBaseUrl, getBrowserTimeout, getBrowserTimeoutRetries, getCapabilities, getChromiumApi, getConfigurationDefaults, getConfigurationFactory, getCookie, getCookies, getCustomProperty, getDeleteCookies, getDriverLifecycle, getEventsEnabled, getHtmlDumpMode, getHtmlDumpPath, getImplicitlyWait, getPageLoadTimeout, getRemoteUrl, getScreenshotMode, getScreenshotPath, getScriptTimeout, getWebDriver, goTo, goTo, goToInNewTab, inject, injectComponent, isComponentClass, isComponentListClass, keyboard, mouse, newComponent, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newFluent, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList, newInstance, pageSource, performanceTiming, setAwaitAtMost, setAwaitPollingEvery, setBaseUrl, setBrowserTimeout, setBrowserTimeoutRetries, setCapabilities, setConfigurationFactory, setCustomProperty, setDeleteCookies, setDriverLifecycle, setEventsEnabled, setHtmlDumpMode, setHtmlDumpPath, setImplicitlyWait, setPageLoadTimeout, setRemoteUrl, setScreenshotMode, setScreenshotPath, setScriptTimeout, setWebDriver, switchTo, switchTo, switchTo, switchToDefault, takeHtmlDump, takeHtmlDump, takeScreenshot, takeScreenshot, url, windowMethods inherited from interface io.fluentlenium.core.search.SearchControl
$, $, $, $, $, el, el, el, elMethods inherited from interface org.openqa.selenium.WebElement
getAccessibleName, getAriaRole, getDomAttribute, getDomProperty, getShadowRoot
-
Constructor Details
-
BaseHook
public BaseHook(FluentControl control, ComponentInstantiator instantiator, Supplier<org.openqa.selenium.WebElement> elementSupplier, Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locatorSupplier, Supplier<String> toStringSupplier, T options) Creates a new base hook.- Parameters:
control- control interfaceinstantiator- component instantiatorelementSupplier- element supplierlocatorSupplier- element locator suppliertoStringSupplier- element toString supplieroptions- hook options
-
-
Method Details
-
getElement
public final org.openqa.selenium.WebElement getElement()Get the underlying element of the hook.Can be another hook, or a real element.
- Returns:
- underlying element
-
getWrappedElement
public org.openqa.selenium.WebElement getWrappedElement()- Specified by:
getWrappedElementin interfaceorg.openqa.selenium.WrapsElement
-
getElementLocator
public final org.openqa.selenium.support.pagefactory.ElementLocator getElementLocator()Get the underlying element locator of the hook.- Returns:
- underlying element locator
-
getCoordinates
public org.openqa.selenium.interactions.Coordinates getCoordinates()Get coordinates of the underlying element.- Specified by:
getCoordinatesin interfaceorg.openqa.selenium.interactions.Locatable- Returns:
- coordinates of underlying element
-
newOptions
Builds default options.- Returns:
- default options
-
getInstantiator
Get the component instantiator.- Returns:
- component instantiator
-
getOptions
Description copied from interface:FluentHookGet the options of the hook.- Specified by:
getOptionsin interfaceFluentHook<T>- Returns:
- hook options
-
toString
-
sendKeys
- Specified by:
sendKeysin interfaceorg.openqa.selenium.WebElement
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> outputType) throws org.openqa.selenium.WebDriverException - Specified by:
getScreenshotAsin interfaceorg.openqa.selenium.TakesScreenshot- Throws:
org.openqa.selenium.WebDriverException
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by) - Specified by:
findElementin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementin interfaceorg.openqa.selenium.WebElement
-
isSelected
public boolean isSelected()- Specified by:
isSelectedin interfaceorg.openqa.selenium.WebElement
-
getRect
public org.openqa.selenium.Rectangle getRect()- Specified by:
getRectin interfaceorg.openqa.selenium.WebElement
-
isDisplayed
public boolean isDisplayed()- Specified by:
isDisplayedin interfaceorg.openqa.selenium.WebElement
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceorg.openqa.selenium.WebElement
-
findElements
- Specified by:
findElementsin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementsin interfaceorg.openqa.selenium.WebElement
-
submit
public void submit()- Specified by:
submitin interfaceorg.openqa.selenium.WebElement
-
getCssValue
- Specified by:
getCssValuein interfaceorg.openqa.selenium.WebElement
-
getTagName
- Specified by:
getTagNamein interfaceorg.openqa.selenium.WebElement
-
getLocation
public org.openqa.selenium.Point getLocation()- Specified by:
getLocationin interfaceorg.openqa.selenium.WebElement
-
getSize
public org.openqa.selenium.Dimension getSize()- Specified by:
getSizein interfaceorg.openqa.selenium.WebElement
-
getText
- Specified by:
getTextin interfaceorg.openqa.selenium.WebElement
-
click
public void click()- Specified by:
clickin interfaceorg.openqa.selenium.WebElement
-
getAttribute
- Specified by:
getAttributein interfaceorg.openqa.selenium.WebElement
-
clear
public void clear()- Specified by:
clearin interfaceorg.openqa.selenium.WebElement
-
findElement
public org.openqa.selenium.WebElement findElement()- Specified by:
findElementin interfaceorg.openqa.selenium.support.pagefactory.ElementLocator
-
findElements
- Specified by:
findElementsin interfaceorg.openqa.selenium.support.pagefactory.ElementLocator
-