Interface FluentControl
- All Superinterfaces:
AlertControl,AwaitControl,CapabilitiesControl,ChromiumControl,ComponentInstantiator,Configuration,ConfigurationMutator,ConfigurationProperties,CssControl,EventsControl,FluentInjectControl,InputControl,JavascriptControl,NavigationControl,PerformanceTimingControl,SearchControl<FluentWebElement>,SeleniumDriverControl,SnapshotControl
- All Known Subinterfaces:
FluentPageControl,IFluentAdapter
- All Known Implementing Classes:
BaseFluentHook,BaseHook,ContainerFluentControl,DefaultFluentContainer,FluentAdapter,FluentControlImpl,FluentDriver,FluentPage,FluentStandalone,FluentStandaloneRunnable,FluentTestRunnerAdapter,IsolatedTest,WaitHook
It allows to control with a Fluent interface the underlying WebDriver.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.fluentlenium.configuration.ConfigurationProperties
ConfigurationProperties.DriverLifecycle, ConfigurationProperties.TriggerMode -
Method Summary
Modifier and TypeMethodDescriptiondefault Alertalert()Get an object to control the alert window.default <L extends List<T>,T>
LasComponentList(Class<L> listClass, Class<T> componentClass, Iterable<org.openqa.selenium.WebElement> elements) Create and register a new list of component from the given element iterable.default <L extends List<T>,T>
LasComponentList(Class<L> listClass, Class<T> componentClass, List<org.openqa.selenium.WebElement> elements) Create and register a new list of component from the given element iterable.default <L extends List<T>,T>
LasComponentList(Class<L> listClass, Class<T> componentClass, org.openqa.selenium.WebElement... elements) Create and register a new list of component from the given element iterable.default <T> ComponentList<T>asComponentList(Class<T> componentClass, Iterable<org.openqa.selenium.WebElement> elements) Create and register a new list of component from the given element iterable.default <T> ComponentList<T>asComponentList(Class<T> componentClass, List<org.openqa.selenium.WebElement> elements) Create and register a new list of component from the given element iterable.default <T> ComponentList<T>asComponentList(Class<T> componentClass, org.openqa.selenium.WebElement... elements) Create and register a new list of component from the given element iterable.default <T extends FluentWebElement>
FluentList<T>asFluentList(Class<T> componentClass, Iterable<org.openqa.selenium.WebElement> elements) Create and register a new fluent list.default <T extends FluentWebElement>
FluentList<T>asFluentList(Class<T> componentClass, List<org.openqa.selenium.WebElement> elements) Create and register a new fluent list.default <T extends FluentWebElement>
FluentList<T>asFluentList(Class<T> componentClass, org.openqa.selenium.WebElement... elements) Create and register a new fluent list.default FluentList<FluentWebElement>asFluentList(Iterable<org.openqa.selenium.WebElement> elements) Create and register a new fluent list from the argument collection of WebElements.default FluentList<FluentWebElement>asFluentList(List<org.openqa.selenium.WebElement> elements) Create and register a new fluent list from the argument list of WebElements.default FluentList<FluentWebElement>asFluentList(org.openqa.selenium.WebElement... elements) Create and register a new fluent list from the argument WebElements.default FluentWaitawait()wait for an asynchronous calldefault booleanCheck if underlyingWebDrivercan take screenshot.default org.openqa.selenium.CapabilitiesGet the actual capabilities of the underlying Selenium WebDriver.default CssSupportcss()Features related to CSS loaded in the active page.default FluentWebElementel(org.openqa.selenium.WebElement rawElement) Wrap existing raw selenium element into an element.default EventsRegistryevents()Retrieves an event registry to register event listeners.default FluentJavascriptexecuteAsyncScript(String script, Object... args) Execute a script, asynchronously.default FluentJavascriptexecuteScript(String script, Object... args) Execute a script, synchronously.default FluentList<FluentWebElement>find(SearchFilter... filters) Find list of elements with filters.default FluentList<FluentWebElement>find(String selector, SearchFilter... filters) Find list of elements with CSS selector and filters.default FluentList<FluentWebElement>Wrap raw selenium elements into a list of elements.default FluentList<FluentWebElement>find(org.openqa.selenium.By locator, SearchFilter... filters) Find list of elements with Selenium locator and filters.default io.appium.java_client.AppiumDriverGet the actual underlying AppiumDriver.default LongawaitAtMostdefault LongawaitPollingEverydefault StringbaseUrldefault LongbrowserTimeoutdefault IntegerbrowserTimeoutRetriesdefault org.openqa.selenium.Capabilitiescapabilitiesdefault ChromiumApiFeatures related to browser control under devtools protocol.Get the test adapter configuration.default Class<? extends ConfigurationProperties>configurationDefaultsdefault Class<? extends ConfigurationFactory>configurationFactoryGet the control interface containerdefault org.openqa.selenium.Cookiereturn the corresponding cookie given a namedefault Set<org.openqa.selenium.Cookie>return the cookies as a setdefault StringgetCustomProperty(String propertyName) Get custom property value.default BooleandeleteCookiesdefault org.openqa.selenium.WebDriverGet the actual underlying Selenium WebDriver.driverLifecycledefault BooleaneventsEnabledGet Fluent ControlhtmlDumpModedefault StringhtmlDumpPathdefault LongimplicitlyWaitdefault LongpageLoadTimeoutdefault StringremoteUrlscreenshotModedefault StringscreenshotPathdefault LongscriptTimeoutdefault StringwebDriverdefault voidOpen the url pagedefault <P extends FluentPage>
PgoTo(P page) Open the page, using the url defined in the pagedefault voidgoToInNewTab(String url) Open the url page in a new tabdefault ContainerContextInject object with FluentLenium resources.default ContainerContextinjectComponent(Object componentContainer, Object parentContainer, org.openqa.selenium.SearchContext context) Inject object with FluentLenium resources, using given search context and parent container.default booleanisComponentClass(Class<?> componentClass) Check if this class is a component class.default booleanisComponentListClass(Class<? extends List<?>> componentListClass) Check if this class is a component list class.default KeyboardActionskeyboard()Execute keyboard actionsdefault MouseActionsmouse()Execute mouse actionsdefault <T> TnewComponent(Class<T> componentClass, org.openqa.selenium.WebElement element) Create and register a new component of the provided type from the givenWebElement.default <L extends List<T>,T>
LnewComponentList(Class<L> listClass, Class<T> componentClass) Create and register an empty list of component.default <L extends List<T>,T>
LnewComponentList(Class<L> listClass, Class<T> componentClass, List<T> componentsList) Create and register a new list of component from the given component list.default <L extends List<T>,T>
LnewComponentList(Class<L> listClass, Class<T> componentClass, T... componentsList) Create and register a new list of component from the given component list.default <T> ComponentList<T>newComponentList(Class<T> componentClass) Create and register an empty list of component.default <T> ComponentList<T>newComponentList(Class<T> componentClass, List<T> componentsList) Create and register a new list of component from the given component list.default <T> ComponentList<T>newComponentList(Class<T> componentClass, T... componentsList) Create and register a new list of component from the given component list.default FluentWebElementnewFluent(org.openqa.selenium.WebElement element) Create and register a newFluentWebElementfrom the givenWebElement.default FluentList<FluentWebElement>Create and register an empty fluent list.default FluentList<FluentWebElement>newFluentList(FluentWebElement... elements) Create and register a new fluent list from the argument FluentWebElements.default <T extends FluentWebElement>
FluentList<T>newFluentList(Class<T> componentClass) Create and register an empty fluent list of the provided type.default <T extends FluentWebElement>
FluentList<T>newFluentList(Class<T> componentClass, List<T> elements) Create and register a new fluent list.default <T extends FluentWebElement>
FluentList<T>newFluentList(Class<T> componentClass, T... elements) Create and register a new fluent list.default FluentList<FluentWebElement>newFluentList(List<FluentWebElement> elements) Create and register a new fluent list from the argument list of FluentWebElements.default <T> TnewInstance(Class<T> cls) Creates a new instance of a class inject it.default StringReturn the source of the pagedefault PerformanceTimingReturns an object for accessing Performance Timing API queries.default voidsetAwaitAtMost(Long awaitAtMost) Sets the value ofdefault voidsetAwaitPollingEvery(Long awaitPollingEvery) Sets the value ofdefault voidsetBaseUrl(String baseUrl) Sets the value ofdefault voidsetBrowserTimeout(Long timeout) Sets the value ofdefault voidsetBrowserTimeoutRetries(Integer retriesNumber) Sets the value ofdefault voidsetCapabilities(org.openqa.selenium.Capabilities capabilities) Sets the value ofdefault voidsetConfigurationFactory(Class<? extends ConfigurationFactory> configurationFactory) Sets the value ofdefault voidsetCustomProperty(String key, String value) Sets custom value for a custom property keydefault voidsetDeleteCookies(Boolean deleteCookies) Sets the value ofdefault voidsetDriverLifecycle(ConfigurationProperties.DriverLifecycle driverLifecycle) Sets the value ofdefault voidsetEventsEnabled(Boolean eventsEnabled) Sets the value ofdefault voidsetHtmlDumpMode(ConfigurationProperties.TriggerMode htmlDumpMode) Sets the value ofdefault voidsetHtmlDumpPath(String htmlDumpPath) Sets the value ofdefault voidsetImplicitlyWait(Long implicitlyWait) Sets the value ofdefault voidsetPageLoadTimeout(Long pageLoadTimeout) Sets the value ofdefault voidsetRemoteUrl(String remoteUrl) Sets the value ofdefault voidsetScreenshotMode(ConfigurationProperties.TriggerMode screenshotMode) Sets the value ofdefault voidsetScreenshotPath(String screenshotPath) Sets the value ofdefault voidsetScriptTimeout(Long scriptTimeout) Sets the value ofdefault voidsetWebDriver(String webDriver) Sets the value ofdefault voidswitchTo()Switch to the default elementdefault voidswitchTo(FluentList<? extends FluentWebElement> elements) Switch to the first selected Element (if element is null or not an iframe, or doesn't have an id then switch to the default)default voidswitchTo(FluentWebElement element) Switch to the selected Element (if element is null or not an iframe, or doesn't have an id then switch to the default)default voidSwitch to the default elementdefault voidTake a html dump of the browser DOM.default voidtakeHtmlDump(String fileName) Take a html dump of the browser DOM into a file given by the fileName param.default FileTake a snapshot of the browser.default FiletakeScreenshot(String fileName) Take a snapshot of the browser into a file given by the fileName param.default Stringurl()Return the url of the page.default WindowActionwindow()Exposes methods on browser window
-
Method Details
-
getControlContainer
FluentControlContainer getControlContainer()Get the control interface container- Returns:
- control interface container
-
getFluentControl
FluentControl getFluentControl()Get Fluent Control- Returns:
- FluentControl instance
-
getConfiguration
Configuration getConfiguration()Get the test adapter configuration.- Returns:
- configuration
-
getConfigurationDefaults
Description copied from interface:ConfigurationPropertiesconfigurationDefaults
property.Set this to a class implementing
ConfigurationPropertiesto provide the default values of the configuration properties.Default value is
ConfigurationDefaults- Specified by:
getConfigurationDefaultsin interfaceConfigurationProperties- Returns:
- Custom
ConfigurationPropertiesinstance with default values.
-
setAwaitPollingEvery
Description copied from interface:ConfigurationMutatorSets the value ofawaitPollingEvery
property- Specified by:
setAwaitPollingEveryin interfaceConfigurationMutator- Parameters:
awaitPollingEvery- property value- See Also:
-
setCustomProperty
Description copied from interface:ConfigurationMutatorSets custom value for a custom property key- Specified by:
setCustomPropertyin interfaceConfigurationMutator- Parameters:
key- custom property keyvalue- custom property value
-
setBrowserTimeoutRetries
Description copied from interface:ConfigurationMutatorSets the value ofbrowserTimeoutRetries
property.- Specified by:
setBrowserTimeoutRetriesin interfaceConfigurationMutator- Parameters:
retriesNumber- property value- See Also:
-
setWebDriver
Description copied from interface:ConfigurationMutatorSets the value ofwebDriver
property.- Specified by:
setWebDriverin interfaceConfigurationMutator- Parameters:
webDriver- property value- See Also:
-
getDeleteCookies
Description copied from interface:ConfigurationPropertiesdeleteCookies
property.When using CLASS or JVM
driverLifecycle
configuration property, allow to delete cookies between each test.Default value is false.
- Specified by:
getDeleteCookiesin interfaceConfigurationProperties- Returns:
- deleteCookies property value.
-
setScreenshotPath
Description copied from interface:ConfigurationMutatorSets the value ofscreenshotPath
property.- Specified by:
setScreenshotPathin interfaceConfigurationMutator- Parameters:
screenshotPath- property value- See Also:
-
getBaseUrl
Description copied from interface:ConfigurationPropertiesbaseUrl
property.Sets the base URL used to build absolute URL when relative URL is given to
goTo(String).Default value is null.
- Specified by:
getBaseUrlin interfaceConfigurationProperties- Returns:
- baseUrl property value
-
setAwaitAtMost
Description copied from interface:ConfigurationMutatorSets the value ofawaitAtMost
property- Specified by:
setAwaitAtMostin interfaceConfigurationMutator- Parameters:
awaitAtMost- property value- See Also:
-
getAwaitAtMost
Description copied from interface:ConfigurationProperties- Specified by:
getAwaitAtMostin interfaceConfigurationProperties- Returns:
- awaitTimeout property value
- See Also:
-
getHtmlDumpMode
Description copied from interface:ConfigurationPropertieshtmlDumpMode
property.Sets the trigger mode of htmlDump. Can be {AUTOMATIC_ON_FAIL} to take html dump when the test fail or {MANUAL}.
Default value is null.
- Specified by:
getHtmlDumpModein interfaceConfigurationProperties- Returns:
- htmlDumpMode property value.
- See Also:
-
getPageLoadTimeout
Description copied from interface:ConfigurationPropertiespageLoadTimeout
property.Sets the amount of time in millisecond to wait for a page load to complete before throwing an error. If the timeout is negative, page loads can be indefinite.
Default value is null.
- Specified by:
getPageLoadTimeoutin interfaceConfigurationProperties- Returns:
- pageLoadTimeout property value
- See Also:
-
setConfigurationFactory
Description copied from interface:ConfigurationMutatorSets the value ofconfigurationFactory
property.- Specified by:
setConfigurationFactoryin interfaceConfigurationMutator- Parameters:
configurationFactory- property value- See Also:
-
setDriverLifecycle
Description copied from interface:ConfigurationMutatorSets the value ofdriverLifecycle
property.- Specified by:
setDriverLifecyclein interfaceConfigurationMutator- Parameters:
driverLifecycle- property value- See Also:
-
getRemoteUrl
Description copied from interface:ConfigurationPropertiesremoteUrl
property.Sets the remoteUrl for "remote" webDriver.
- Specified by:
getRemoteUrlin interfaceConfigurationProperties- Returns:
- remoteUrl property value
- See Also:
-
getEventsEnabled
Description copied from interface:ConfigurationPropertieseventsEnabled
property.Enables
events()by wrapping theWebDriverinEventFiringWebDriver.Default value is true.
- Specified by:
getEventsEnabledin interfaceConfigurationProperties- Returns:
- eventsEnabled property value.
-
setHtmlDumpMode
Description copied from interface:ConfigurationMutatorSets the value ofhtmlDumpMode
property.- Specified by:
setHtmlDumpModein interfaceConfigurationMutator- Parameters:
htmlDumpMode- property value- See Also:
-
getHtmlDumpPath
Description copied from interface:ConfigurationPropertieshtmlDumpPath
property.Sets the filesystem path where screenshot will be saved when calling
takeHtmlDump()ortakeHtmlDump(String).Default value is null.
- Specified by:
getHtmlDumpPathin interfaceConfigurationProperties- Returns:
- htmlDumpPath property value
-
getAwaitPollingEvery
Description copied from interface:ConfigurationPropertiesawaitPollingEvery
property.Sets the default polling frequency in millisecond when using
await()orWaithook.- Specified by:
getAwaitPollingEveryin interfaceConfigurationProperties- Returns:
- awaitPollingEvery property value
- See Also:
-
setScriptTimeout
Description copied from interface:ConfigurationMutatorSets the value ofscriptTimeout
property.- Specified by:
setScriptTimeoutin interfaceConfigurationMutator- Parameters:
scriptTimeout- property value- See Also:
-
getConfigurationFactory
Description copied from interface:ConfigurationPropertiesconfigurationFactory
property.Set this to a class implementing
ConfigurationFactoryto customize the ways properties are read. This allow to configure properties from sources that are not supported by default FluentLenium.Default value is
DefaultConfigurationFactoryclass.- Specified by:
getConfigurationFactoryin interfaceConfigurationProperties- Returns:
- Custom
ConfigurationFactoryclass.
-
getScreenshotPath
Description copied from interface:ConfigurationPropertiesscreenshotPath
property.Sets the filesystem path where screenshot will be saved when calling
takeScreenshot()ortakeScreenshot(String).Default value is null.
- Specified by:
getScreenshotPathin interfaceConfigurationProperties- Returns:
- screenshotPath property value
-
getBrowserTimeoutRetries
Description copied from interface:ConfigurationPropertiesbrowserTimeoutRetries
property.Sets the maximum number of retries for failed WebDriver because of browserTimeout issues.
Default value is 2 times.
- Specified by:
getBrowserTimeoutRetriesin interfaceConfigurationProperties- Returns:
- Integer
-
setBrowserTimeout
Description copied from interface:ConfigurationMutatorSets the value ofbrowserTimeout
property.- Specified by:
setBrowserTimeoutin interfaceConfigurationMutator- Parameters:
timeout- property value- See Also:
-
setRemoteUrl
Description copied from interface:ConfigurationMutatorSets the value ofremoteUrl
property.- Specified by:
setRemoteUrlin interfaceConfigurationMutator- Parameters:
remoteUrl- property value- See Also:
-
getWebDriver
Description copied from interface:ConfigurationPropertieswebDriver
property.Sets the WebDriver type to use.
When FluentLenium needs to create a new
WebDriverinstance, it callsIFluentAdapter.newWebDriver()which delegates toWebDriversRegistryImpl.newWebDriver(String, Capabilities, ConfigurationProperties)registry using the value stored in webDriver and capabilities property.Possible values are "firefox", "chrome", "ie", "edge", "htmlunit", "safari", "opera", "remote" or any class name implementing
WebDriveror any name that is defined in the `@FactoryName` annotation of a `WebDriverFactory` implementation.Default value is "firefox".
- Specified by:
getWebDriverin interfaceConfigurationProperties- Returns:
- webDriver property value
- See Also:
-
getDriver
default org.openqa.selenium.WebDriver getDriver()Description copied from interface:SeleniumDriverControlGet the actual underlying Selenium WebDriver.To customize the WebDriver, you should configure
getWebDriver()or overrideIFluentAdapter.newWebDriver().This method can't be overridden to customize the WebDriver.
- Specified by:
getDriverin interfaceSeleniumDriverControl- Returns:
- The actual underlying Selenium WebDriver
-
getAppiumDriver
default io.appium.java_client.AppiumDriver getAppiumDriver()Description copied from interface:SeleniumDriverControlGet the actual underlying AppiumDriver.To customize the WebDriver, you should configure
getWebDriver()or overrideIFluentAdapter.newWebDriver().This method can't be overridden to customize the AppiumDriver.
- Specified by:
getAppiumDriverin interfaceSeleniumDriverControl- Returns:
- The actual underlying AppiumDriver
-
getCustomProperty
Description copied from interface:ConfigurationPropertiesGet custom property value.- Specified by:
getCustomPropertyin interfaceConfigurationProperties- Parameters:
propertyName- name of the property- Returns:
- property value
-
setDeleteCookies
Description copied from interface:ConfigurationMutatorSets the value ofdeleteCookies
property.- Specified by:
setDeleteCookiesin interfaceConfigurationMutator- Parameters:
deleteCookies- property value- See Also:
-
setEventsEnabled
Description copied from interface:ConfigurationMutatorSets the value ofeventsEnabled
property.- Specified by:
setEventsEnabledin interfaceConfigurationMutator- Parameters:
eventsEnabled- property value
-
setHtmlDumpPath
Description copied from interface:ConfigurationMutatorSets the value ofhtmlDumpPath
property.- Specified by:
setHtmlDumpPathin interfaceConfigurationMutator- Parameters:
htmlDumpPath- property value- See Also:
-
setPageLoadTimeout
Description copied from interface:ConfigurationMutatorSets the value ofpageLoadTimeout
property.- Specified by:
setPageLoadTimeoutin interfaceConfigurationMutator- Parameters:
pageLoadTimeout- property value- See Also:
-
setScreenshotMode
Description copied from interface:ConfigurationMutatorSets the value ofscreenshotMode
property.- Specified by:
setScreenshotModein interfaceConfigurationMutator- Parameters:
screenshotMode- property value- See Also:
-
getBrowserTimeout
Description copied from interface:ConfigurationPropertiesbrowserTimeout
property.Sets the maximum amount of time when the browser should start responding to the WebDriver.
Default value is 60 seconds.
- Specified by:
getBrowserTimeoutin interfaceConfigurationProperties- Returns:
- long
-
setBaseUrl
Description copied from interface:ConfigurationMutatorSets the value ofbaseUrl
property.- Specified by:
setBaseUrlin interfaceConfigurationMutator- Parameters:
baseUrl- property value- See Also:
-
getDriverLifecycle
Description copied from interface:ConfigurationPropertiesdriverLifecycle
property.Sets the lifecycle of the WebDriver. WebDriver is fully managed by FluentLenium, so you should never create or quit a WebDriver by yourself.
Please keep in mind that this configures when drivers are created and exited at runtime, but it does not deal with concurrency of your tests.
Default value is METHOD.
- Specified by:
getDriverLifecyclein interfaceConfigurationProperties- Returns:
- driverLifecycle property value
-
getImplicitlyWait
Description copied from interface:ConfigurationPropertiesimplicitlyWait
property.Specifies the amount of time in millisecond the driver should wait when searching for an element if it is not immediately present.
Default value is null.
- Specified by:
getImplicitlyWaitin interfaceConfigurationProperties- Returns:
- implicitlyWait property value
- See Also:
-
setImplicitlyWait
Description copied from interface:ConfigurationMutatorSets the value ofimplicitlyWait
property.- Specified by:
setImplicitlyWaitin interfaceConfigurationMutator- Parameters:
implicitlyWait- property value- See Also:
-
getCapabilities
default org.openqa.selenium.Capabilities getCapabilities()Description copied from interface:ConfigurationPropertiescapabilities
property.Sets the Capabilities to use, as a JSON Object or a URL pointing to a JSON Object.
Default value is "null".
- Specified by:
getCapabilitiesin interfaceConfigurationProperties- Returns:
- Capabilities property value
- See Also:
-
getScriptTimeout
Description copied from interface:ConfigurationPropertiesscriptTimeout
property.Sets the amount of time in millisecond to wait for an asynchronous script to finish execution before throwing an error. If the timeout is negative, then the script will be allowed to run indefinitely.
Default value is null.
- Specified by:
getScriptTimeoutin interfaceConfigurationProperties- Returns:
- scriptTimeout property value
- See Also:
-
setCapabilities
default void setCapabilities(org.openqa.selenium.Capabilities capabilities) Description copied from interface:ConfigurationMutatorSets the value ofcapabilities
property.- Specified by:
setCapabilitiesin interfaceConfigurationMutator- Parameters:
capabilities- property value- See Also:
-
getScreenshotMode
Description copied from interface:ConfigurationPropertiesscreenshotMode
property.Sets the trigger mode of screenshots. Can be {AUTOMATIC_ON_FAIL} to take screenshot when the test fail or {MANUAL}.
Default value is null.
- Specified by:
getScreenshotModein interfaceConfigurationProperties- Returns:
- screenshotMode property value.
- See Also:
-
takeScreenshot
Description copied from interface:SnapshotControlTake a snapshot of the browser into a file given by the fileName param.- Specified by:
takeScreenshotin interfaceSnapshotControl- Parameters:
fileName- file name for screenshot- Returns:
- the screenshot file
-
getChromiumApi
Description copied from interface:ChromiumControlFeatures related to browser control under devtools protocol.- Specified by:
getChromiumApiin interfaceChromiumControl- Returns:
- a new chromium api instance
-
asFluentList
Description copied from interface:ComponentInstantiatorCreate and register a new fluent list from the argument WebElements.- Specified by:
asFluentListin interfaceComponentInstantiator- Parameters:
elements- list of elements- Returns:
- new list of fluent web element
-
goTo
Description copied from interface:NavigationControlOpen the page, using the url defined in the page- Specified by:
goToin interfaceNavigationControl- Type Parameters:
P- Type of FluentPage- Parameters:
page- page to open- Returns:
- Opened page.
- See Also:
-
executeScript
Description copied from interface:JavascriptControlExecute a script, synchronously.- Specified by:
executeScriptin interfaceJavascriptControl- Parameters:
script- script source to executeargs- script arguments- Returns:
- an object wrapping the result
-
asComponentList
default <L extends List<T>,T> L asComponentList(Class<L> listClass, Class<T> componentClass, Iterable<org.openqa.selenium.WebElement> elements) Description copied from interface:ComponentInstantiatorCreate and register a new list of component from the given element iterable.- Specified by:
asComponentListin interfaceComponentInstantiator- Type Parameters:
L- type of the listT- type of the component- Parameters:
listClass- type of the listcomponentClass- type of the componentelements- elements- Returns:
- new list of components
-
switchToDefault
default void switchToDefault()Description copied from interface:NavigationControlSwitch to the default element- Specified by:
switchToDefaultin interfaceNavigationControl
-
asComponentList
default <T> ComponentList<T> asComponentList(Class<T> componentClass, org.openqa.selenium.WebElement... elements) Description copied from interface:ComponentInstantiatorCreate and register a new list of component from the given element iterable.- Specified by:
asComponentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- type of the componentelements- elements- Returns:
- new list of components
-
find
Description copied from interface:SearchControlFind list of elements with Selenium locator and filters.- Specified by:
findin interfaceSearchControl<FluentWebElement>- Parameters:
locator- elements locatorfilters- filters set- Returns:
- list of elements
-
goTo
Description copied from interface:NavigationControlOpen the url page- Specified by:
goToin interfaceNavigationControl- Parameters:
url- page URL to visit
-
switchTo
default void switchTo()Description copied from interface:NavigationControlSwitch to the default element- Specified by:
switchToin interfaceNavigationControl
-
takeHtmlDump
default void takeHtmlDump()Description copied from interface:SnapshotControlTake a html dump of the browser DOM. By default the file will be a html named by the current timestamp.- Specified by:
takeHtmlDumpin interfaceSnapshotControl
-
injectComponent
default ContainerContext injectComponent(Object componentContainer, Object parentContainer, org.openqa.selenium.SearchContext context) Description copied from interface:FluentInjectControlInject object with FluentLenium resources, using given search context and parent container.- Specified by:
injectComponentin interfaceFluentInjectControl- Parameters:
componentContainer- container to inject with FluentLenium resourcesparentContainer- parent containercontext- search context to use for injection- Returns:
- The container context related to the injected container
-
switchTo
Description copied from interface:NavigationControlSwitch to the first selected Element (if element is null or not an iframe, or doesn't have an id then switch to the default)- Specified by:
switchToin interfaceNavigationControl- Parameters:
elements- fluent list of fluent web elements
-
canTakeScreenShot
default boolean canTakeScreenShot()Description copied from interface:SnapshotControlCheck if underlyingWebDrivercan take screenshot.- Specified by:
canTakeScreenShotin interfaceSnapshotControl- Returns:
- true if screenshot can be taken, false otherwise
-
newComponentList
Description copied from interface:ComponentInstantiatorCreate and register an empty list of component.- Specified by:
newComponentListin interfaceComponentInstantiator- Type Parameters:
L- type of the listT- type of the component- Parameters:
listClass- type of the listcomponentClass- type of the component- Returns:
- new list of components
-
asFluentList
default <T extends FluentWebElement> FluentList<T> asFluentList(Class<T> componentClass, Iterable<org.openqa.selenium.WebElement> elements) Description copied from interface:ComponentInstantiatorCreate and register a new fluent list.- Specified by:
asFluentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- class of the componentelements- list of elements- Returns:
- new list of fluent web element
-
newFluentList
default <T extends FluentWebElement> FluentList<T> newFluentList(Class<T> componentClass, List<T> elements) Description copied from interface:ComponentInstantiatorCreate and register a new fluent list.- Specified by:
newFluentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- class of the componentelements- list of elements- Returns:
- new list of fluent web element
-
capabilities
default org.openqa.selenium.Capabilities capabilities()Description copied from interface:CapabilitiesControlGet the actual capabilities of the underlying Selenium WebDriver.- Specified by:
capabilitiesin interfaceCapabilitiesControl- Returns:
- actual capabilities.
- See Also:
-
newFluentList
Description copied from interface:ComponentInstantiatorCreate and register an empty fluent list of the provided type.- Specified by:
newFluentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- class of the component- Returns:
- new list of fluent web element
-
newComponentList
default <L extends List<T>,T> L newComponentList(Class<L> listClass, Class<T> componentClass, T... componentsList) Description copied from interface:ComponentInstantiatorCreate and register a new list of component from the given component list.- Specified by:
newComponentListin interfaceComponentInstantiator- Type Parameters:
L- type of the listT- type of the component- Parameters:
listClass- type of the listcomponentClass- type of the componentcomponentsList- components list- Returns:
- new list of components
-
newFluentList
Description copied from interface:ComponentInstantiatorCreate and register an empty fluent list.- Specified by:
newFluentListin interfaceComponentInstantiator- Returns:
- new list of fluent web element
-
asComponentList
default <T> ComponentList<T> asComponentList(Class<T> componentClass, Iterable<org.openqa.selenium.WebElement> elements) Description copied from interface:ComponentInstantiatorCreate and register a new list of component from the given element iterable.- Specified by:
asComponentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- type of the componentelements- elements- Returns:
- new list of components
-
css
Description copied from interface:CssControlFeatures related to CSS loaded in the active page.- Specified by:
cssin interfaceCssControl- Returns:
- a CssSupport instance
-
asFluentList
default <T extends FluentWebElement> FluentList<T> asFluentList(Class<T> componentClass, List<org.openqa.selenium.WebElement> elements) Description copied from interface:ComponentInstantiatorCreate and register a new fluent list.- Specified by:
asFluentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- class of the componentelements- list of elements- Returns:
- new list of fluent web element
-
find
Description copied from interface:SearchControlWrap raw selenium elements into a list of elements.- Specified by:
findin interfaceSearchControl<FluentWebElement>- Parameters:
rawElements- raw selenium elements- Returns:
- list of element
-
takeHtmlDump
Description copied from interface:SnapshotControlTake a html dump of the browser DOM into a file given by the fileName param.- Specified by:
takeHtmlDumpin interfaceSnapshotControl- Parameters:
fileName- file name for html dump
-
find
Description copied from interface:SearchControlFind list of elements with CSS selector and filters.- Specified by:
findin interfaceSearchControl<FluentWebElement>- Parameters:
selector- CSS selectorfilters- set of filters- Returns:
- list of element
-
newComponentList
Description copied from interface:ComponentInstantiatorCreate and register a new list of component from the given component list.- Specified by:
newComponentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- type of the componentcomponentsList- components list- Returns:
- new list of components
-
asComponentList
default <L extends List<T>,T> L asComponentList(Class<L> listClass, Class<T> componentClass, org.openqa.selenium.WebElement... elements) Description copied from interface:ComponentInstantiatorCreate and register a new list of component from the given element iterable.- Specified by:
asComponentListin interfaceComponentInstantiator- Type Parameters:
L- type of the listT- type of the component- Parameters:
listClass- type of the listcomponentClass- type of the componentelements- elements- Returns:
- new list of components
-
asComponentList
default <T> ComponentList<T> asComponentList(Class<T> componentClass, List<org.openqa.selenium.WebElement> elements) Description copied from interface:ComponentInstantiatorCreate and register a new list of component from the given element iterable.- Specified by:
asComponentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- type of the componentelements- elements- Returns:
- new list of components
-
goToInNewTab
Description copied from interface:NavigationControlOpen the url page in a new tab- Specified by:
goToInNewTabin interfaceNavigationControl- Parameters:
url- the url of the page
-
window
Description copied from interface:NavigationControlExposes methods on browser window- Specified by:
windowin interfaceNavigationControl- Returns:
- Window actions
-
newComponentList
Description copied from interface:ComponentInstantiatorCreate and register an empty list of component.- Specified by:
newComponentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- type of the component- Returns:
- new list of components
-
newFluent
Description copied from interface:ComponentInstantiatorCreate and register a newFluentWebElementfrom the givenWebElement.- Specified by:
newFluentin interfaceComponentInstantiator- Parameters:
element- wrapped element- Returns:
- new instance of the component
-
alert
Description copied from interface:AlertControlGet an object to control the alert window.- Specified by:
alertin interfaceAlertControl- Returns:
- an alert object
-
keyboard
Description copied from interface:InputControlExecute keyboard actions- Specified by:
keyboardin interfaceInputControl- Returns:
- mouse keyboard object
-
await
Description copied from interface:AwaitControlwait for an asynchronous call- Specified by:
awaitin interfaceAwaitControl- Returns:
- FluentWait element
-
isComponentClass
Description copied from interface:ComponentInstantiatorCheck if this class is a component class.- Specified by:
isComponentClassin interfaceComponentInstantiator- Parameters:
componentClass- class to check- Returns:
- true if this class is a component class, false otherwise
-
newInstance
Description copied from interface:FluentInjectControlCreates a new instance of a class inject it.- Specified by:
newInstancein interfaceFluentInjectControl- Type Parameters:
T- type of the object- Parameters:
cls- class of the object to create- Returns:
- new container instance
- See Also:
-
asFluentList
default <T extends FluentWebElement> FluentList<T> asFluentList(Class<T> componentClass, org.openqa.selenium.WebElement... elements) Description copied from interface:ComponentInstantiatorCreate and register a new fluent list.- Specified by:
asFluentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- class of the componentelements- list of elements- Returns:
- new list of fluent web element
-
asComponentList
default <L extends List<T>,T> L asComponentList(Class<L> listClass, Class<T> componentClass, List<org.openqa.selenium.WebElement> elements) Description copied from interface:ComponentInstantiatorCreate and register a new list of component from the given element iterable.- Specified by:
asComponentListin interfaceComponentInstantiator- Type Parameters:
L- type of the listT- type of the component- Parameters:
listClass- type of the listcomponentClass- type of the componentelements- elements- Returns:
- new list of components
-
mouse
Description copied from interface:InputControlExecute mouse actions- Specified by:
mousein interfaceInputControl- Returns:
- mouse actions object
-
inject
Description copied from interface:FluentInjectControlInject object with FluentLenium resources.- Specified by:
injectin interfaceFluentInjectControl- Parameters:
container- container to inject with FluentLenium resources- Returns:
- The container context related to the injected container
-
takeScreenshot
Description copied from interface:SnapshotControlTake a snapshot of the browser. By default the file will be a png named by the current timestamp.- Specified by:
takeScreenshotin interfaceSnapshotControl- Returns:
- the screenshot file
-
getCookies
Description copied from interface:NavigationControlreturn the cookies as a set- Specified by:
getCookiesin interfaceNavigationControl- Returns:
- set of cookies
-
asFluentList
default FluentList<FluentWebElement> asFluentList(Iterable<org.openqa.selenium.WebElement> elements) Description copied from interface:ComponentInstantiatorCreate and register a new fluent list from the argument collection of WebElements.- Specified by:
asFluentListin interfaceComponentInstantiator- Parameters:
elements- list of elements- Returns:
- new list of fluent web element
-
getCookie
Description copied from interface:NavigationControlreturn the corresponding cookie given a name- Specified by:
getCookiein interfaceNavigationControl- Parameters:
name- cookie name- Returns:
- cookie selected by name
-
newComponentList
Description copied from interface:ComponentInstantiatorCreate and register a new list of component from the given component list.- Specified by:
newComponentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- type of the componentcomponentsList- components list- Returns:
- new list of components
-
find
Description copied from interface:SearchControlFind list of elements with filters.- Specified by:
findin interfaceSearchControl<FluentWebElement>- Parameters:
filters- set of filters in the current context- Returns:
- list of elements
-
newFluentList
Description copied from interface:ComponentInstantiatorCreate and register a new fluent list from the argument FluentWebElements.- Specified by:
newFluentListin interfaceComponentInstantiator- Parameters:
elements- list of elements- Returns:
- new list of fluent web element
-
newComponentList
default <L extends List<T>,T> L newComponentList(Class<L> listClass, Class<T> componentClass, List<T> componentsList) Description copied from interface:ComponentInstantiatorCreate and register a new list of component from the given component list.- Specified by:
newComponentListin interfaceComponentInstantiator- Type Parameters:
L- type of the listT- type of the component- Parameters:
listClass- type of the listcomponentClass- type of the componentcomponentsList- components list- Returns:
- new list of components
-
switchTo
Description copied from interface:NavigationControlSwitch to the selected Element (if element is null or not an iframe, or doesn't have an id then switch to the default)- Specified by:
switchToin interfaceNavigationControl- Parameters:
element- fluent web element to switch to
-
pageSource
Description copied from interface:NavigationControlReturn the source of the page- Specified by:
pageSourcein interfaceNavigationControl- Returns:
- source of the page under test
-
isComponentListClass
Description copied from interface:ComponentInstantiatorCheck if this class is a component list class.- Specified by:
isComponentListClassin interfaceComponentInstantiator- Parameters:
componentListClass- class to check- Returns:
- true if this class is a component list class, false otherwise
-
newFluentList
Description copied from interface:ComponentInstantiatorCreate and register a new fluent list from the argument list of FluentWebElements.- Specified by:
newFluentListin interfaceComponentInstantiator- Parameters:
elements- list of elements- Returns:
- new list of fluent web element
-
executeAsyncScript
Description copied from interface:JavascriptControlExecute a script, asynchronously.- Specified by:
executeAsyncScriptin interfaceJavascriptControl- Parameters:
script- script source to executeargs- script arguments- Returns:
- an object wrapping the result
-
url
Description copied from interface:NavigationControlReturn the url of the page. If a base url is provided, the current url will be relative to that base url.- Specified by:
urlin interfaceNavigationControl- Returns:
- current URL
-
newComponent
Description copied from interface:ComponentInstantiatorCreate and register a new component of the provided type from the givenWebElement.- Specified by:
newComponentin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- type of the componentelement- wrapped element- Returns:
- new instance of the component
-
newFluentList
default <T extends FluentWebElement> FluentList<T> newFluentList(Class<T> componentClass, T... elements) Description copied from interface:ComponentInstantiatorCreate and register a new fluent list.- Specified by:
newFluentListin interfaceComponentInstantiator- Type Parameters:
T- type of the component- Parameters:
componentClass- class of the componentelements- list of elements- Returns:
- new list of fluent web element
-
asFluentList
Description copied from interface:ComponentInstantiatorCreate and register a new fluent list from the argument list of WebElements.- Specified by:
asFluentListin interfaceComponentInstantiator- Parameters:
elements- list of elements- Returns:
- new list of fluent web element
-
el
Description copied from interface:SearchControlWrap existing raw selenium element into an element.- Specified by:
elin interfaceSearchControl<FluentWebElement>- Parameters:
rawElement- raw selenium element- Returns:
- element
-
events
Description copied from interface:EventsControlRetrieves an event registry to register event listeners.- Specified by:
eventsin interfaceEventsControl- Returns:
- the event registry.
-
performanceTiming
Description copied from interface:PerformanceTimingControlReturns an object for accessing Performance Timing API queries.- Specified by:
performanceTimingin interfacePerformanceTimingControl- Returns:
- a
PerformanceTimingobject
-