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
,FluentCucumberTest
,FluentDriver
,FluentPage
,FluentStandalone
,FluentStandaloneRunnable
,FluentTest
,FluentTest
,FluentTestNg
,FluentTestNgSpringTest
,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 Alert
alert()
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 FluentWait
await()
wait for an asynchronous calldefault boolean
Check if underlyingWebDriver
can take screenshot.default org.openqa.selenium.Capabilities
Get the actual capabilities of the underlying Selenium WebDriver.default CssSupport
css()
Features related to CSS loaded in the active page.default FluentWebElement
el
(org.openqa.selenium.WebElement rawElement) Wrap existing raw selenium element into an element.default EventsRegistry
events()
Retrieves an event registry to register event listeners.default FluentJavascript
executeAsyncScript
(String script, Object... args) Execute a script, asynchronously.default FluentJavascript
executeScript
(String script, Object... args) Execute a script, synchronously.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
(SearchFilter... filters) Find list of elements with filters.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.AppiumDriver
Get the actual underlying AppiumDriver.default Long
awaitAtMostdefault Long
awaitPollingEverydefault String
baseUrldefault Long
browserTimeoutdefault Integer
browserTimeoutRetriesdefault org.openqa.selenium.Capabilities
capabilitiesdefault ChromiumApi
Features 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.Cookie
return the corresponding cookie given a namedefault Set<org.openqa.selenium.Cookie>
return the cookies as a setdefault String
getCustomProperty
(String propertyName) Get custom property value.default Boolean
deleteCookiesdefault org.openqa.selenium.WebDriver
Get the actual underlying Selenium WebDriver.driverLifecycledefault Boolean
eventsEnabledGet Fluent ControlhtmlDumpModedefault String
htmlDumpPathdefault Long
implicitlyWaitdefault Long
pageLoadTimeoutdefault String
remoteUrlscreenshotModedefault String
screenshotPathdefault Long
scriptTimeoutdefault String
webDriverdefault void
Open the url pagedefault <P extends FluentPage>
PgoTo
(P page) Open the page, using the url defined in the pagedefault void
goToInNewTab
(String url) Open the url page in a new tabdefault ContainerContext
Inject object with FluentLenium resources.default ContainerContext
injectComponent
(Object componentContainer, Object parentContainer, org.openqa.selenium.SearchContext context) Inject object with FluentLenium resources, using given search context and parent container.default boolean
isComponentClass
(Class<?> componentClass) Check if this class is a component class.default boolean
isComponentListClass
(Class<? extends List<?>> componentListClass) Check if this class is a component list class.default KeyboardActions
keyboard()
Execute keyboard actionsdefault MouseActions
mouse()
Execute mouse actionsdefault <T> T
newComponent
(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 FluentWebElement
newFluent
(org.openqa.selenium.WebElement element) Create and register a newFluentWebElement
from the givenWebElement
.default FluentList<FluentWebElement>
Create and register an empty fluent list.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 FluentList<FluentWebElement>
newFluentList
(FluentWebElement... elements) Create and register a new fluent list from the argument FluentWebElements.default <T> T
newInstance
(Class<T> cls) Creates a new instance of a class inject it.default String
Return the source of the pagedefault PerformanceTiming
Returns an object for accessing Performance Timing API queries.default void
setAwaitAtMost
(Long awaitAtMost) Sets the value ofdefault void
setAwaitPollingEvery
(Long awaitPollingEvery) Sets the value ofdefault void
setBaseUrl
(String baseUrl) Sets the value ofdefault void
setBrowserTimeout
(Long timeout) Sets the value ofdefault void
setBrowserTimeoutRetries
(Integer retriesNumber) Sets the value ofdefault void
setCapabilities
(org.openqa.selenium.Capabilities capabilities) Sets the value ofdefault void
setConfigurationFactory
(Class<? extends ConfigurationFactory> configurationFactory) Sets the value ofdefault void
setCustomProperty
(String key, String value) Sets custom value for a custom property keydefault void
setDeleteCookies
(Boolean deleteCookies) Sets the value ofdefault void
setDriverLifecycle
(ConfigurationProperties.DriverLifecycle driverLifecycle) Sets the value ofdefault void
setEventsEnabled
(Boolean eventsEnabled) Sets the value ofdefault void
setHtmlDumpMode
(ConfigurationProperties.TriggerMode htmlDumpMode) Sets the value ofdefault void
setHtmlDumpPath
(String htmlDumpPath) Sets the value ofdefault void
setImplicitlyWait
(Long implicitlyWait) Sets the value ofdefault void
setPageLoadTimeout
(Long pageLoadTimeout) Sets the value ofdefault void
setRemoteUrl
(String remoteUrl) Sets the value ofdefault void
setScreenshotMode
(ConfigurationProperties.TriggerMode screenshotMode) Sets the value ofdefault void
setScreenshotPath
(String screenshotPath) Sets the value ofdefault void
setScriptTimeout
(Long scriptTimeout) Sets the value ofdefault void
setWebDriver
(String webDriver) Sets the value ofdefault void
switchTo()
Switch to the default elementdefault void
switchTo
(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 void
switchTo
(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 void
Switch to the default elementdefault void
Take a html dump of the browser DOM.default void
takeHtmlDump
(String fileName) Take a html dump of the browser DOM into a file given by the fileName param.default File
Take a snapshot of the browser.default File
takeScreenshot
(String fileName) Take a snapshot of the browser into a file given by the fileName param.default String
url()
Return the url of the page.default WindowAction
window()
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:ConfigurationProperties
configurationDefaults
property. Set this to a class implementingConfigurationProperties
to provide the default values of the configuration properties. Default value isConfigurationDefaults
- Specified by:
getConfigurationDefaults
in interfaceConfigurationProperties
- Returns:
- Custom
ConfigurationProperties
instance with default values.
-
setAwaitPollingEvery
Description copied from interface:ConfigurationMutator
Sets the value ofawaitPollingEvery
property- Specified by:
setAwaitPollingEvery
in interfaceConfigurationMutator
- Parameters:
awaitPollingEvery
- property value- See Also:
-
setCustomProperty
Description copied from interface:ConfigurationMutator
Sets custom value for a custom property key- Specified by:
setCustomProperty
in interfaceConfigurationMutator
- Parameters:
key
- custom property keyvalue
- custom property value
-
setBrowserTimeoutRetries
Description copied from interface:ConfigurationMutator
Sets the value ofbrowserTimeoutRetries
property.- Specified by:
setBrowserTimeoutRetries
in interfaceConfigurationMutator
- Parameters:
retriesNumber
- property value- See Also:
-
setWebDriver
Description copied from interface:ConfigurationMutator
Sets the value ofwebDriver
property.- Specified by:
setWebDriver
in interfaceConfigurationMutator
- Parameters:
webDriver
- property value- See Also:
-
getDeleteCookies
Description copied from interface:ConfigurationProperties
deleteCookies
property. When using CLASS or JVMdriverLifecycle
configuration property, allow to delete cookies between each test. Default value is false.- Specified by:
getDeleteCookies
in interfaceConfigurationProperties
- Returns:
- deleteCookies property value.
-
setScreenshotPath
Description copied from interface:ConfigurationMutator
Sets the value ofscreenshotPath
property.- Specified by:
setScreenshotPath
in interfaceConfigurationMutator
- Parameters:
screenshotPath
- property value- See Also:
-
getBaseUrl
Description copied from interface:ConfigurationProperties
baseUrl
property. Sets the base URL used to build absolute URL when relative URL is given togoTo(String)
. Default value is null.- Specified by:
getBaseUrl
in interfaceConfigurationProperties
- Returns:
- baseUrl property value
-
setAwaitAtMost
Description copied from interface:ConfigurationMutator
Sets the value ofawaitAtMost
property- Specified by:
setAwaitAtMost
in interfaceConfigurationMutator
- Parameters:
awaitAtMost
- property value- See Also:
-
getAwaitAtMost
Description copied from interface:ConfigurationProperties
- Specified by:
getAwaitAtMost
in interfaceConfigurationProperties
- Returns:
- awaitTimeout property value
- See Also:
-
getHtmlDumpMode
Description copied from interface:ConfigurationProperties
htmlDumpMode
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:
getHtmlDumpMode
in interfaceConfigurationProperties
- Returns:
- htmlDumpMode property value.
- See Also:
-
getPageLoadTimeout
Description copied from interface:ConfigurationProperties
pageLoadTimeout
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:
getPageLoadTimeout
in interfaceConfigurationProperties
- Returns:
- pageLoadTimeout property value
- See Also:
-
WebDriver.Timeouts.pageLoadTimeout(long, java.util.concurrent.TimeUnit)
-
setConfigurationFactory
Description copied from interface:ConfigurationMutator
Sets the value ofconfigurationFactory
property.- Specified by:
setConfigurationFactory
in interfaceConfigurationMutator
- Parameters:
configurationFactory
- property value- See Also:
-
setDriverLifecycle
Description copied from interface:ConfigurationMutator
Sets the value ofdriverLifecycle
property.- Specified by:
setDriverLifecycle
in interfaceConfigurationMutator
- Parameters:
driverLifecycle
- property value- See Also:
-
getRemoteUrl
Description copied from interface:ConfigurationProperties
remoteUrl
property. Sets the remoteUrl for "remote" webDriver.- Specified by:
getRemoteUrl
in interfaceConfigurationProperties
- Returns:
- remoteUrl property value
- See Also:
-
RemoteWebDriver
-
getEventsEnabled
Description copied from interface:ConfigurationProperties
eventsEnabled
property. Enablesevents()
by wrapping theWebDriver
inEventFiringWebDriver
. Default value is true.- Specified by:
getEventsEnabled
in interfaceConfigurationProperties
- Returns:
- eventsEnabled property value.
-
setHtmlDumpMode
Description copied from interface:ConfigurationMutator
Sets the value ofhtmlDumpMode
property.- Specified by:
setHtmlDumpMode
in interfaceConfigurationMutator
- Parameters:
htmlDumpMode
- property value- See Also:
-
getHtmlDumpPath
Description copied from interface:ConfigurationProperties
htmlDumpPath
property. Sets the filesystem path where screenshot will be saved when callingtakeHtmlDump()
ortakeHtmlDump(String)
. Default value is null.- Specified by:
getHtmlDumpPath
in interfaceConfigurationProperties
- Returns:
- htmlDumpPath property value
-
getAwaitPollingEvery
Description copied from interface:ConfigurationProperties
awaitPollingEvery
property. Sets the default polling frequency in millisecond when usingawait()
orWait
hook.- Specified by:
getAwaitPollingEvery
in interfaceConfigurationProperties
- Returns:
- awaitPollingEvery property value
- See Also:
-
setScriptTimeout
Description copied from interface:ConfigurationMutator
Sets the value ofscriptTimeout
property.- Specified by:
setScriptTimeout
in interfaceConfigurationMutator
- Parameters:
scriptTimeout
- property value- See Also:
-
getConfigurationFactory
Description copied from interface:ConfigurationProperties
configurationFactory
property. Set this to a class implementingConfigurationFactory
to customize the ways properties are read. This allow to configure properties from sources that are not supported by default FluentLenium. Default value isDefaultConfigurationFactory
class.- Specified by:
getConfigurationFactory
in interfaceConfigurationProperties
- Returns:
- Custom
ConfigurationFactory
class.
-
getScreenshotPath
Description copied from interface:ConfigurationProperties
screenshotPath
property. Sets the filesystem path where screenshot will be saved when callingtakeScreenshot()
ortakeScreenshot(String)
. Default value is null.- Specified by:
getScreenshotPath
in interfaceConfigurationProperties
- Returns:
- screenshotPath property value
-
getBrowserTimeoutRetries
Description copied from interface:ConfigurationProperties
browserTimeoutRetries
property. Sets the maximum number of retries for failed WebDriver because of browserTimeout issues. Default value is 2 times.- Specified by:
getBrowserTimeoutRetries
in interfaceConfigurationProperties
- Returns:
- Integer
-
setBrowserTimeout
Description copied from interface:ConfigurationMutator
Sets the value ofbrowserTimeout
property.- Specified by:
setBrowserTimeout
in interfaceConfigurationMutator
- Parameters:
timeout
- property value- See Also:
-
setRemoteUrl
Description copied from interface:ConfigurationMutator
Sets the value ofremoteUrl
property.- Specified by:
setRemoteUrl
in interfaceConfigurationMutator
- Parameters:
remoteUrl
- property value- See Also:
-
getWebDriver
Description copied from interface:ConfigurationProperties
webDriver
property.Sets the WebDriver type to use.
When FluentLenium needs to create a new
WebDriver
instance, 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
WebDriver
or any name that is defined in the `@FactoryName` annotation of a `WebDriverFactory` implementation.Default value is "firefox".
- Specified by:
getWebDriver
in interfaceConfigurationProperties
- Returns:
- webDriver property value
- See Also:
-
getDriver
default org.openqa.selenium.WebDriver getDriver()Description copied from interface:SeleniumDriverControl
Get 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:
getDriver
in interfaceSeleniumDriverControl
- Returns:
- The actual underlying Selenium WebDriver
-
getAppiumDriver
default io.appium.java_client.AppiumDriver getAppiumDriver()Description copied from interface:SeleniumDriverControl
Get 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:
getAppiumDriver
in interfaceSeleniumDriverControl
- Returns:
- The actual underlying AppiumDriver
-
getCustomProperty
Description copied from interface:ConfigurationProperties
Get custom property value.- Specified by:
getCustomProperty
in interfaceConfigurationProperties
- Parameters:
propertyName
- name of the property- Returns:
- property value
-
setDeleteCookies
Description copied from interface:ConfigurationMutator
Sets the value ofdeleteCookies
property.- Specified by:
setDeleteCookies
in interfaceConfigurationMutator
- Parameters:
deleteCookies
- property value- See Also:
-
setEventsEnabled
Description copied from interface:ConfigurationMutator
Sets the value ofeventsEnabled
property.- Specified by:
setEventsEnabled
in interfaceConfigurationMutator
- Parameters:
eventsEnabled
- property value
-
setHtmlDumpPath
Description copied from interface:ConfigurationMutator
Sets the value ofhtmlDumpPath
property.- Specified by:
setHtmlDumpPath
in interfaceConfigurationMutator
- Parameters:
htmlDumpPath
- property value- See Also:
-
setPageLoadTimeout
Description copied from interface:ConfigurationMutator
Sets the value ofpageLoadTimeout
property.- Specified by:
setPageLoadTimeout
in interfaceConfigurationMutator
- Parameters:
pageLoadTimeout
- property value- See Also:
-
setScreenshotMode
Description copied from interface:ConfigurationMutator
Sets the value ofscreenshotMode
property.- Specified by:
setScreenshotMode
in interfaceConfigurationMutator
- Parameters:
screenshotMode
- property value- See Also:
-
getBrowserTimeout
Description copied from interface:ConfigurationProperties
browserTimeout
property. Sets the maximum amount of time when the browser should start responding to the WebDriver. Default value is 60 seconds.- Specified by:
getBrowserTimeout
in interfaceConfigurationProperties
- Returns:
- long
-
setBaseUrl
Description copied from interface:ConfigurationMutator
Sets the value ofbaseUrl
property.- Specified by:
setBaseUrl
in interfaceConfigurationMutator
- Parameters:
baseUrl
- property value- See Also:
-
getDriverLifecycle
Description copied from interface:ConfigurationProperties
driverLifecycle
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:
getDriverLifecycle
in interfaceConfigurationProperties
- Returns:
- driverLifecycle property value
-
getImplicitlyWait
Description copied from interface:ConfigurationProperties
implicitlyWait
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:
getImplicitlyWait
in interfaceConfigurationProperties
- Returns:
- implicitlyWait property value
- See Also:
-
WebDriver.Timeouts.implicitlyWait(long, java.util.concurrent.TimeUnit)
-
setImplicitlyWait
Description copied from interface:ConfigurationMutator
Sets the value ofimplicitlyWait
property.- Specified by:
setImplicitlyWait
in interfaceConfigurationMutator
- Parameters:
implicitlyWait
- property value- See Also:
-
getCapabilities
default org.openqa.selenium.Capabilities getCapabilities()Description copied from interface:ConfigurationProperties
capabilities
property. Sets the Capabilities to use, as a JSON Object or a URL pointing to a JSON Object. Default value is "null".- Specified by:
getCapabilities
in interfaceConfigurationProperties
- Returns:
- Capabilities property value
- See Also:
-
Capabilities
- Selenium DesiredCapabilities Wiki Page
-
getScriptTimeout
Description copied from interface:ConfigurationProperties
scriptTimeout
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:
getScriptTimeout
in interfaceConfigurationProperties
- Returns:
- scriptTimeout property value
- See Also:
-
WebDriver.Timeouts.setScriptTimeout(long, java.util.concurrent.TimeUnit)
-
setCapabilities
default void setCapabilities(org.openqa.selenium.Capabilities capabilities) Description copied from interface:ConfigurationMutator
Sets the value ofcapabilities
property.- Specified by:
setCapabilities
in interfaceConfigurationMutator
- Parameters:
capabilities
- property value- See Also:
-
getScreenshotMode
Description copied from interface:ConfigurationProperties
screenshotMode
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:
getScreenshotMode
in interfaceConfigurationProperties
- Returns:
- screenshotMode property value.
- See Also:
-
takeScreenshot
Description copied from interface:SnapshotControl
Take a snapshot of the browser into a file given by the fileName param.- Specified by:
takeScreenshot
in interfaceSnapshotControl
- Parameters:
fileName
- file name for screenshot- Returns:
- the screenshot file
-
getChromiumApi
Description copied from interface:ChromiumControl
Features related to browser control under devtools protocol.- Specified by:
getChromiumApi
in interfaceChromiumControl
- Returns:
- a new chromium api instance
-
asFluentList
Description copied from interface:ComponentInstantiator
Create and register a new fluent list from the argument WebElements.- Specified by:
asFluentList
in interfaceComponentInstantiator
- Parameters:
elements
- list of elements- Returns:
- new list of fluent web element
-
goTo
Description copied from interface:NavigationControl
Open the page, using the url defined in the page- Specified by:
goTo
in interfaceNavigationControl
- Type Parameters:
P
- Type of FluentPage- Parameters:
page
- page to open- Returns:
- Opened page.
- See Also:
-
executeScript
Description copied from interface:JavascriptControl
Execute a script, synchronously.- Specified by:
executeScript
in 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:ComponentInstantiator
Create and register a new list of component from the given element iterable.- Specified by:
asComponentList
in 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:NavigationControl
Switch to the default element- Specified by:
switchToDefault
in interfaceNavigationControl
-
asComponentList
default <T> ComponentList<T> asComponentList(Class<T> componentClass, org.openqa.selenium.WebElement... elements) Description copied from interface:ComponentInstantiator
Create and register a new list of component from the given element iterable.- Specified by:
asComponentList
in 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:SearchControl
Find list of elements with Selenium locator and filters.- Specified by:
find
in interfaceSearchControl<FluentWebElement>
- Parameters:
locator
- elements locatorfilters
- filters set- Returns:
- list of elements
-
goTo
Description copied from interface:NavigationControl
Open the url page- Specified by:
goTo
in interfaceNavigationControl
- Parameters:
url
- page URL to visit
-
switchTo
default void switchTo()Description copied from interface:NavigationControl
Switch to the default element- Specified by:
switchTo
in interfaceNavigationControl
-
takeHtmlDump
default void takeHtmlDump()Description copied from interface:SnapshotControl
Take a html dump of the browser DOM. By default the file will be a html named by the current timestamp.- Specified by:
takeHtmlDump
in interfaceSnapshotControl
-
injectComponent
default ContainerContext injectComponent(Object componentContainer, Object parentContainer, org.openqa.selenium.SearchContext context) Description copied from interface:FluentInjectControl
Inject object with FluentLenium resources, using given search context and parent container.- Specified by:
injectComponent
in 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:NavigationControl
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)- Specified by:
switchTo
in interfaceNavigationControl
- Parameters:
elements
- fluent list of fluent web elements
-
canTakeScreenShot
default boolean canTakeScreenShot()Description copied from interface:SnapshotControl
Check if underlyingWebDriver
can take screenshot.- Specified by:
canTakeScreenShot
in interfaceSnapshotControl
- Returns:
- true if screenshot can be taken, false otherwise
-
newComponentList
Description copied from interface:ComponentInstantiator
Create and register an empty list of component.- Specified by:
newComponentList
in 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:ComponentInstantiator
Create and register a new fluent list.- Specified by:
asFluentList
in 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:ComponentInstantiator
Create and register a new fluent list.- Specified by:
newFluentList
in 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:CapabilitiesControl
Get the actual capabilities of the underlying Selenium WebDriver.- Specified by:
capabilities
in interfaceCapabilitiesControl
- Returns:
- actual capabilities.
- See Also:
-
HasCapabilities.getCapabilities()
-
newFluentList
Description copied from interface:ComponentInstantiator
Create and register an empty fluent list of the provided type.- Specified by:
newFluentList
in 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:ComponentInstantiator
Create and register a new list of component from the given component list.- Specified by:
newComponentList
in 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:ComponentInstantiator
Create and register an empty fluent list.- Specified by:
newFluentList
in 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:ComponentInstantiator
Create and register a new list of component from the given element iterable.- Specified by:
asComponentList
in 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:CssControl
Features related to CSS loaded in the active page.- Specified by:
css
in 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:ComponentInstantiator
Create and register a new fluent list.- Specified by:
asFluentList
in 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:SearchControl
Wrap raw selenium elements into a list of elements.- Specified by:
find
in interfaceSearchControl<FluentWebElement>
- Parameters:
rawElements
- raw selenium elements- Returns:
- list of element
-
takeHtmlDump
Description copied from interface:SnapshotControl
Take a html dump of the browser DOM into a file given by the fileName param.- Specified by:
takeHtmlDump
in interfaceSnapshotControl
- Parameters:
fileName
- file name for html dump
-
find
Description copied from interface:SearchControl
Find list of elements with CSS selector and filters.- Specified by:
find
in interfaceSearchControl<FluentWebElement>
- Parameters:
selector
- CSS selectorfilters
- set of filters- Returns:
- list of element
-
newComponentList
Description copied from interface:ComponentInstantiator
Create and register a new list of component from the given component list.- Specified by:
newComponentList
in 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:ComponentInstantiator
Create and register a new list of component from the given element iterable.- Specified by:
asComponentList
in 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:ComponentInstantiator
Create and register a new list of component from the given element iterable.- Specified by:
asComponentList
in 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:NavigationControl
Open the url page in a new tab- Specified by:
goToInNewTab
in interfaceNavigationControl
- Parameters:
url
- the url of the page
-
window
Description copied from interface:NavigationControl
Exposes methods on browser window- Specified by:
window
in interfaceNavigationControl
- Returns:
- Window actions
-
newComponentList
Description copied from interface:ComponentInstantiator
Create and register an empty list of component.- Specified by:
newComponentList
in interfaceComponentInstantiator
- Type Parameters:
T
- type of the component- Parameters:
componentClass
- type of the component- Returns:
- new list of components
-
newFluent
Description copied from interface:ComponentInstantiator
Create and register a newFluentWebElement
from the givenWebElement
.- Specified by:
newFluent
in interfaceComponentInstantiator
- Parameters:
element
- wrapped element- Returns:
- new instance of the component
-
alert
Description copied from interface:AlertControl
Get an object to control the alert window.- Specified by:
alert
in interfaceAlertControl
- Returns:
- an alert object
-
keyboard
Description copied from interface:InputControl
Execute keyboard actions- Specified by:
keyboard
in interfaceInputControl
- Returns:
- mouse keyboard object
-
await
Description copied from interface:AwaitControl
wait for an asynchronous call- Specified by:
await
in interfaceAwaitControl
- Returns:
- FluentWait element
-
isComponentClass
Description copied from interface:ComponentInstantiator
Check if this class is a component class.- Specified by:
isComponentClass
in interfaceComponentInstantiator
- Parameters:
componentClass
- class to check- Returns:
- true if this class is a component class, false otherwise
-
newInstance
Description copied from interface:FluentInjectControl
Creates a new instance of a class inject it.- Specified by:
newInstance
in 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:ComponentInstantiator
Create and register a new fluent list.- Specified by:
asFluentList
in 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:ComponentInstantiator
Create and register a new list of component from the given element iterable.- Specified by:
asComponentList
in 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:InputControl
Execute mouse actions- Specified by:
mouse
in interfaceInputControl
- Returns:
- mouse actions object
-
inject
Description copied from interface:FluentInjectControl
Inject object with FluentLenium resources.- Specified by:
inject
in interfaceFluentInjectControl
- Parameters:
container
- container to inject with FluentLenium resources- Returns:
- The container context related to the injected container
-
takeScreenshot
Description copied from interface:SnapshotControl
Take a snapshot of the browser. By default the file will be a png named by the current timestamp.- Specified by:
takeScreenshot
in interfaceSnapshotControl
- Returns:
- the screenshot file
-
getCookies
Description copied from interface:NavigationControl
return the cookies as a set- Specified by:
getCookies
in interfaceNavigationControl
- Returns:
- set of cookies
-
asFluentList
default FluentList<FluentWebElement> asFluentList(Iterable<org.openqa.selenium.WebElement> elements) Description copied from interface:ComponentInstantiator
Create and register a new fluent list from the argument collection of WebElements.- Specified by:
asFluentList
in interfaceComponentInstantiator
- Parameters:
elements
- list of elements- Returns:
- new list of fluent web element
-
getCookie
Description copied from interface:NavigationControl
return the corresponding cookie given a name- Specified by:
getCookie
in interfaceNavigationControl
- Parameters:
name
- cookie name- Returns:
- cookie selected by name
-
newComponentList
Description copied from interface:ComponentInstantiator
Create and register a new list of component from the given component list.- Specified by:
newComponentList
in 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:SearchControl
Find list of elements with filters.- Specified by:
find
in interfaceSearchControl<FluentWebElement>
- Parameters:
filters
- set of filters in the current context- Returns:
- list of elements
-
newFluentList
Description copied from interface:ComponentInstantiator
Create and register a new fluent list from the argument FluentWebElements.- Specified by:
newFluentList
in 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:ComponentInstantiator
Create and register a new list of component from the given component list.- Specified by:
newComponentList
in 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:NavigationControl
Switch 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:
switchTo
in interfaceNavigationControl
- Parameters:
element
- fluent web element to switch to
-
pageSource
Description copied from interface:NavigationControl
Return the source of the page- Specified by:
pageSource
in interfaceNavigationControl
- Returns:
- source of the page under test
-
isComponentListClass
Description copied from interface:ComponentInstantiator
Check if this class is a component list class.- Specified by:
isComponentListClass
in interfaceComponentInstantiator
- Parameters:
componentListClass
- class to check- Returns:
- true if this class is a component list class, false otherwise
-
newFluentList
Description copied from interface:ComponentInstantiator
Create and register a new fluent list from the argument list of FluentWebElements.- Specified by:
newFluentList
in interfaceComponentInstantiator
- Parameters:
elements
- list of elements- Returns:
- new list of fluent web element
-
executeAsyncScript
Description copied from interface:JavascriptControl
Execute a script, asynchronously.- Specified by:
executeAsyncScript
in interfaceJavascriptControl
- Parameters:
script
- script source to executeargs
- script arguments- Returns:
- an object wrapping the result
-
url
Description copied from interface:NavigationControl
Return the url of the page. If a base url is provided, the current url will be relative to that base url.- Specified by:
url
in interfaceNavigationControl
- Returns:
- current URL
-
newComponent
Description copied from interface:ComponentInstantiator
Create and register a new component of the provided type from the givenWebElement
.- Specified by:
newComponent
in 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:ComponentInstantiator
Create and register a new fluent list.- Specified by:
newFluentList
in 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:ComponentInstantiator
Create and register a new fluent list from the argument list of WebElements.- Specified by:
asFluentList
in interfaceComponentInstantiator
- Parameters:
elements
- list of elements- Returns:
- new list of fluent web element
-
el
Description copied from interface:SearchControl
Wrap existing raw selenium element into an element.- Specified by:
el
in interfaceSearchControl<FluentWebElement>
- Parameters:
rawElement
- raw selenium element- Returns:
- element
-
events
Description copied from interface:EventsControl
Retrieves an event registry to register event listeners.- Specified by:
events
in interfaceEventsControl
- Returns:
- the event registry.
-
performanceTiming
Description copied from interface:PerformanceTimingControl
Returns an object for accessing Performance Timing API queries.- Specified by:
performanceTiming
in interfacePerformanceTimingControl
- Returns:
- a
PerformanceTiming
object
-