Package org.fluentlenium.core
Class FluentControlImpl
- java.lang.Object
-
- org.fluentlenium.core.FluentControlImpl
-
- All Implemented Interfaces:
Configuration,ConfigurationMutator,ConfigurationProperties,InputControl,AlertControl,CapabilitiesControl,ComponentInstantiator,CssControl,EventsControl,FluentControl,FluentInjectControl,NavigationControl,JavascriptControl,SearchControl<FluentWebElement>,SeleniumDriverControl,SnapshotControl,AwaitControl
- Direct Known Subclasses:
ContainerFluentControl,DefaultFluentContainer,FluentAdapter,FluentDriver
public abstract class FluentControlImpl extends java.lang.Object implements FluentControl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.fluentlenium.configuration.ConfigurationProperties
ConfigurationProperties.DriverLifecycle, ConfigurationProperties.TriggerMode
-
-
Constructor Summary
Constructors Constructor Description FluentControlImpl()FluentControlImpl(FluentControlContainer controlContainer)FluentControlImpl(FluentControlContainer controlContainer, java.lang.Class clazz)Creates a new fluent adapter, using given control interface container.FluentControlImpl(FluentControl fluentControl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Alertalert()Get an object to control the alert window.<L extends java.util.List<T>,T>
LasComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass, java.lang.Iterable<org.openqa.selenium.WebElement> elements)Create and register a new list of component from the given element iterable.<L extends java.util.List<T>,T>
LasComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass, java.util.List<org.openqa.selenium.WebElement> elements)Create and register a new list of component from the given element iterable.<L extends java.util.List<T>,T>
LasComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass, org.openqa.selenium.WebElement... elements)Create and register a new list of component from the given element iterable.<T> ComponentListasComponentList(java.lang.Class<T> componentClass, java.lang.Iterable<org.openqa.selenium.WebElement> elements)Create and register a new list of component from the given element iterable.<T> ComponentList<T>asComponentList(java.lang.Class<T> componentClass, java.util.List<org.openqa.selenium.WebElement> elements)Create and register a new list of component from the given element iterable.<T> ComponentList<T>asComponentList(java.lang.Class<T> componentClass, org.openqa.selenium.WebElement... elements)Create and register a new list of component from the given element iterable.<T extends FluentWebElement>
FluentList<T>asFluentList(java.lang.Class<T> componentClass, java.lang.Iterable<org.openqa.selenium.WebElement> elements)create and register a new fluent list.<T extends FluentWebElement>
FluentList<T>asFluentList(java.lang.Class<T> componentClass, java.util.List<org.openqa.selenium.WebElement> elements)create and register a new fluent list.<T extends FluentWebElement>
FluentList<T>asFluentList(java.lang.Class<T> componentClass, org.openqa.selenium.WebElement... elements)create and register a new fluent list.FluentList<FluentWebElement>asFluentList(java.lang.Iterable<org.openqa.selenium.WebElement> elements)create and register a new fluent list.FluentList<FluentWebElement>asFluentList(java.util.List<org.openqa.selenium.WebElement> elements)create and register a new fluent list.FluentList<FluentWebElement>asFluentList(org.openqa.selenium.WebElement... elements)create and register a new fluent list.FluentWaitawait()wait for an asynchronous callbooleancanTakeScreenShot()Check if underlyingWebDrivercan take screenshot.org.openqa.selenium.Capabilitiescapabilities()Get the actual capabilities of the underlying Selenium WebDriver.CssSupportcss()Features related to CSS loaded in the active page.FluentWebElementel(org.openqa.selenium.WebElement rawElement)Wrap existing raw selenium element into an element.EventsRegistryevents()Retrieves an event registry to register event listeners.FluentJavascriptexecuteAsyncScript(java.lang.String script, java.lang.Object... args)Execute a script, asynchronously.FluentJavascriptexecuteScript(java.lang.String script, java.lang.Object... args)Execute a script, synchronously.FluentList<FluentWebElement>find(java.lang.String selector, SearchFilter... filters)Find list of elements with CSS selector and filters.FluentList<FluentWebElement>find(java.util.List<org.openqa.selenium.WebElement> rawElements)Wrap raw selenium elements into a list of elements.FluentList<FluentWebElement>find(SearchFilter... filters)Find list of elements with filters.FluentList<FluentWebElement>find(org.openqa.selenium.By locator, SearchFilter... filters)Find list of elements with Selenium locator and filters.java.lang.LonggetAwaitAtMost()awaitAtMostjava.lang.LonggetAwaitPollingEvery()awaitPollingEveryjava.lang.StringgetBaseUrl()baseUrljava.lang.LonggetBrowserTimeout()browserTimeoutjava.lang.IntegergetBrowserTimeoutRetries()browserTimeoutRetriesorg.openqa.selenium.CapabilitiesgetCapabilities()capabilitiesConfigurationgetConfiguration()Get the test adapter configuration.java.lang.Class<? extends ConfigurationProperties>getConfigurationDefaults()configurationDefaultsjava.lang.Class<? extends ConfigurationFactory>getConfigurationFactory()configurationFactoryFluentControlContainergetControlContainer()Get the control interface containerorg.openqa.selenium.CookiegetCookie(java.lang.String name)return the corresponding cookie given a namejava.util.Set<org.openqa.selenium.Cookie>getCookies()return the cookies as a setjava.lang.StringgetCustomProperty(java.lang.String propertyName)Get custom property value.java.lang.BooleangetDeleteCookies()deleteCookiesConfigurationProperties.DriverLifecyclegetDriverLifecycle()driverLifecyclejava.lang.BooleangetEventsEnabled()eventsEnabledFluentControlgetFluentControl()ConfigurationProperties.TriggerModegetHtmlDumpMode()htmlDumpModejava.lang.StringgetHtmlDumpPath()htmlDumpPathjava.lang.LonggetImplicitlyWait()implicitlyWaitjava.lang.LonggetPageLoadTimeout()pageLoadTimeoutjava.lang.StringgetRemoteUrl()remoteUrlConfigurationProperties.TriggerModegetScreenshotMode()screenshotModejava.lang.StringgetScreenshotPath()screenshotPathjava.lang.LonggetScriptTimeout()scriptTimeoutjava.lang.StringgetWebDriver()webDrivervoidgoTo(java.lang.String url)Open the url page<P extends FluentPage>
PgoTo(P page)Open the page, using the url defined in the pagevoidgoToInNewTab(java.lang.String url)Open the url page in a new tabContainerContextinject(java.lang.Object container)Inject object with FluentLenium resources.ContainerContextinjectComponent(java.lang.Object componentContainer, java.lang.Object parentContainer, org.openqa.selenium.SearchContext context)Inject object with FluentLenium resources, using given search context and parent container.booleanisComponentClass(java.lang.Class<?> componentClass)Check if this class is a component class.booleanisComponentListClass(java.lang.Class<? extends java.util.List<?>> componentListClass)Check if this class is a component list class.KeyboardActionskeyboard()Execute keyboard actionsMouseActionsmouse()Execute mouse actions<T> TnewComponent(java.lang.Class<T> componentClass, org.openqa.selenium.WebElement element)Create and register a new component from the given element.<L extends java.util.List<T>,T>
LnewComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass)Create and register an empty list of component.<L extends java.util.List<T>,T>
LnewComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass, java.util.List<T> componentsList)Create and register a new list of component from the given component list.<L extends java.util.List<T>,T>
LnewComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass, T... componentsList)Create and register a new list of component from the given component list.<T> ComponentList<T>newComponentList(java.lang.Class<T> componentClass)Create and register an empty list of component.<T> ComponentList<T>newComponentList(java.lang.Class<T> componentClass, java.util.List<T> componentsList)Create and register a new list of component from the given component list.<T> ComponentList<T>newComponentList(java.lang.Class<T> componentClass, T... componentsList)Create and register a new list of component from the given component list.FluentWebElementnewFluent(org.openqa.selenium.WebElement element)Create and register a new fluent element from the given element.FluentList<FluentWebElement>newFluentList()create and register an empty fluent list.<T extends FluentWebElement>
FluentList<T>newFluentList(java.lang.Class<T> componentClass)create and register an empty fluent list.<T extends FluentWebElement>
FluentList<T>newFluentList(java.lang.Class<T> componentClass, java.util.List<T> elements)create and register a new fluent list.<T extends FluentWebElement>
FluentList<T>newFluentList(java.lang.Class<T> componentClass, T... elements)create and register a new fluent list.FluentList<FluentWebElement>newFluentList(java.util.List<FluentWebElement> elements)create and register a new fluent list.FluentList<FluentWebElement>newFluentList(FluentWebElement... elements)create and register a new fluent list.<T> TnewInstance(java.lang.Class<T> cls)Creates a new instance of a class inject it.java.lang.StringpageSource()Return the source of the pagevoidsetAwaitAtMost(java.lang.Long awaitAtMost)Sets the value ofvoidsetAwaitPollingEvery(java.lang.Long awaitPollingEvery)Sets the value ofvoidsetBaseUrl(java.lang.String baseUrl)Sets the value ofvoidsetBrowserTimeout(java.lang.Long timeout)Sets the value ofvoidsetBrowserTimeoutRetries(java.lang.Integer retriesNumber)Sets the value ofvoidsetCapabilities(org.openqa.selenium.Capabilities capabilities)Sets the value ofvoidsetConfigurationFactory(java.lang.Class<? extends ConfigurationFactory> configurationFactory)Sets the value ofvoidsetCustomProperty(java.lang.String key, java.lang.String value)Sets custom value for a custom property keyvoidsetDeleteCookies(java.lang.Boolean deleteCookies)Sets the value ofvoidsetDriverLifecycle(ConfigurationProperties.DriverLifecycle driverLifecycle)Sets the value ofvoidsetEventsEnabled(java.lang.Boolean eventsEnabled)Sets the value ofvoidsetHtmlDumpMode(ConfigurationProperties.TriggerMode htmlDumpMode)Sets the value ofvoidsetHtmlDumpPath(java.lang.String htmlDumpPath)Sets the value ofvoidsetImplicitlyWait(java.lang.Long implicitlyWait)Sets the value ofvoidsetPageLoadTimeout(java.lang.Long pageLoadTimeout)Sets the value ofvoidsetRemoteUrl(java.lang.String remoteUrl)Sets the value ofvoidsetScreenshotMode(ConfigurationProperties.TriggerMode screenshotMode)Sets the value ofvoidsetScreenshotPath(java.lang.String screenshotPath)Sets the value ofvoidsetScriptTimeout(java.lang.Long scriptTimeout)Sets the value ofvoidsetWebDriver(java.lang.String webDriver)Sets the value ofvoidswitchTo()Switch to the default elementvoidswitchTo(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)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)voidswitchToDefault()Switch to the default elementvoidtakeHtmlDump()Take a html dump of the browser DOM.voidtakeHtmlDump(java.lang.String fileName)Take a html dump of the browser DOM into a file given by the fileName param.voidtakeScreenshot()Take a snapshot of the browser.voidtakeScreenshot(java.lang.String fileName)Take a snapshot of the browser into a file given by the fileName param.java.lang.Stringurl()Return the url of the page.WindowActionwindow()Exposes methods on browser window-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.fluentlenium.core.SeleniumDriverControl
getDriver
-
-
-
-
Constructor Detail
-
FluentControlImpl
public FluentControlImpl()
-
FluentControlImpl
public FluentControlImpl(FluentControlContainer controlContainer)
-
FluentControlImpl
public FluentControlImpl(FluentControlContainer controlContainer, java.lang.Class clazz)
Creates a new fluent adapter, using given control interface container.- Parameters:
controlContainer- control interface containerclazz- class from which annotation configuration will be looked up
-
FluentControlImpl
public FluentControlImpl(FluentControl fluentControl)
-
-
Method Detail
-
getControlContainer
public FluentControlContainer getControlContainer()
Get the control interface container- Returns:
- control interface container
-
getFluentControl
public FluentControl getFluentControl()
-
getConfiguration
public Configuration getConfiguration()
Get the test adapter configuration.- Returns:
- configuration
-
getConfigurationDefaults
public java.lang.Class<? extends ConfigurationProperties> getConfigurationDefaults()
Description copied from interface:ConfigurationPropertiesconfigurationDefaults
property. Set this to a class implementingConfigurationPropertiesto provide the default values of the configuration properties. Default value isConfigurationDefaults- Specified by:
getConfigurationDefaultsin interfaceConfigurationProperties- Returns:
- Custom
ConfigurationPropertiesinstance with default values.
-
setAwaitPollingEvery
public void setAwaitPollingEvery(java.lang.Long awaitPollingEvery)
Description copied from interface:ConfigurationMutatorSets the value ofawaitPollingEvery
property- Specified by:
setAwaitPollingEveryin interfaceConfigurationMutator- Parameters:
awaitPollingEvery- property value- See Also:
ConfigurationProperties.getAwaitPollingEvery()
-
setCustomProperty
public void setCustomProperty(java.lang.String key, java.lang.String value)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
public void setBrowserTimeoutRetries(java.lang.Integer retriesNumber)
Description copied from interface:ConfigurationMutatorSets the value ofbrowserTimeoutRetries
property.- Specified by:
setBrowserTimeoutRetriesin interfaceConfigurationMutator- Parameters:
retriesNumber- property value- See Also:
ConfigurationProperties.getBrowserTimeoutRetries()
-
setWebDriver
public void setWebDriver(java.lang.String webDriver)
Description copied from interface:ConfigurationMutatorSets the value ofwebDriver
property.- Specified by:
setWebDriverin interfaceConfigurationMutator- Parameters:
webDriver- property value- See Also:
ConfigurationProperties.getWebDriver()
-
getDeleteCookies
public java.lang.Boolean getDeleteCookies()
Description copied from interface:ConfigurationPropertiesdeleteCookies
property. When using CLASS or JVMdriverLifecycle
configuration property, allow to delete cookies between each test. Default value is false.- Specified by:
getDeleteCookiesin interfaceConfigurationProperties- Returns:
- deleteCookies property value.
-
setScreenshotPath
public void setScreenshotPath(java.lang.String screenshotPath)
Description copied from interface:ConfigurationMutatorSets the value ofscreenshotPath
property.- Specified by:
setScreenshotPathin interfaceConfigurationMutator- Parameters:
screenshotPath- property value- See Also:
ConfigurationProperties.getScreenshotPath()
-
getBaseUrl
public java.lang.String getBaseUrl()
Description copied from interface:ConfigurationPropertiesbaseUrl
property. Sets the base URL used to build absolute URL when relative URL is given togoTo(String). Default value is null.- Specified by:
getBaseUrlin interfaceConfigurationProperties- Returns:
- baseUrl property value
-
setAwaitAtMost
public void setAwaitAtMost(java.lang.Long awaitAtMost)
Description copied from interface:ConfigurationMutatorSets the value ofawaitAtMost
property- Specified by:
setAwaitAtMostin interfaceConfigurationMutator- Parameters:
awaitAtMost- property value- See Also:
ConfigurationProperties.getAwaitAtMost()
-
getAwaitAtMost
public java.lang.Long getAwaitAtMost()
Description copied from interface:ConfigurationPropertiesawaitAtMost
property. Sets the default timeout in millisecond when usingAwaitControl.await()orWaithook.- Specified by:
getAwaitAtMostin interfaceConfigurationProperties- Returns:
- awaitTimeout property value
- See Also:
FluentWaitConfiguration.atMost(long, java.util.concurrent.TimeUnit),FluentWaitConfiguration.atMost(long)
-
getHtmlDumpMode
public ConfigurationProperties.TriggerMode 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:
ConfigurationProperties.TriggerMode
-
getPageLoadTimeout
public java.lang.Long 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:
WebDriver.Timeouts.pageLoadTimeout(long, java.util.concurrent.TimeUnit)
-
setConfigurationFactory
public void setConfigurationFactory(java.lang.Class<? extends ConfigurationFactory> configurationFactory)
Description copied from interface:ConfigurationMutatorSets the value ofconfigurationFactory
property.- Specified by:
setConfigurationFactoryin interfaceConfigurationMutator- Parameters:
configurationFactory- property value- See Also:
ConfigurationProperties.getConfigurationFactory()
-
setDriverLifecycle
public void setDriverLifecycle(ConfigurationProperties.DriverLifecycle driverLifecycle)
Description copied from interface:ConfigurationMutatorSets the value ofdriverLifecycle
property.- Specified by:
setDriverLifecyclein interfaceConfigurationMutator- Parameters:
driverLifecycle- property value- See Also:
ConfigurationProperties.getDriverLifecycle()
-
getRemoteUrl
public java.lang.String getRemoteUrl()
Description copied from interface:ConfigurationPropertiesremoteUrl
property. Sets the remoteUrl for "remote" webDriver.- Specified by:
getRemoteUrlin interfaceConfigurationProperties- Returns:
- remoteUrl property value
- See Also:
RemoteWebDriver
-
getEventsEnabled
public java.lang.Boolean getEventsEnabled()
Description copied from interface:ConfigurationPropertieseventsEnabled
property. Enablesevents()by wrapping theWebDriverinEventFiringWebDriver. Default value is true.- Specified by:
getEventsEnabledin interfaceConfigurationProperties- Returns:
- eventsEnabled property value.
-
setHtmlDumpMode
public void setHtmlDumpMode(ConfigurationProperties.TriggerMode htmlDumpMode)
Description copied from interface:ConfigurationMutatorSets the value ofhtmlDumpMode
property.- Specified by:
setHtmlDumpModein interfaceConfigurationMutator- Parameters:
htmlDumpMode- property value- See Also:
ConfigurationProperties.getHtmlDumpMode()
-
getHtmlDumpPath
public java.lang.String getHtmlDumpPath()
Description copied from interface:ConfigurationPropertieshtmlDumpPath
property. Sets the filesystem path where screenshot will be saved when callingtakeHtmlDump()ortakeHtmlDump(String). Default value is null.- Specified by:
getHtmlDumpPathin interfaceConfigurationProperties- Returns:
- htmlDumpPath property value
-
getAwaitPollingEvery
public java.lang.Long getAwaitPollingEvery()
Description copied from interface:ConfigurationPropertiesawaitPollingEvery
property. Sets the default polling frequency in millisecond when usingAwaitControl.await()orWaithook.- Specified by:
getAwaitPollingEveryin interfaceConfigurationProperties- Returns:
- awaitPollingEvery property value
- See Also:
FluentWaitConfiguration.pollingEvery(long, java.util.concurrent.TimeUnit),FluentWaitConfiguration.pollingEvery(long)
-
setScriptTimeout
public void setScriptTimeout(java.lang.Long scriptTimeout)
Description copied from interface:ConfigurationMutatorSets the value ofscriptTimeout
property.- Specified by:
setScriptTimeoutin interfaceConfigurationMutator- Parameters:
scriptTimeout- property value- See Also:
ConfigurationProperties.getScriptTimeout()
-
getConfigurationFactory
public java.lang.Class<? extends ConfigurationFactory> getConfigurationFactory()
Description copied from interface:ConfigurationPropertiesconfigurationFactory
property. Set this to a class implementingConfigurationFactoryto customize the ways properties are read. This allow to configure properties from sources that are not supported by default FluentLenium. Default value isDefaultConfigurationFactoryclass.- Specified by:
getConfigurationFactoryin interfaceConfigurationProperties- Returns:
- Custom
ConfigurationFactoryclass.
-
getScreenshotPath
public java.lang.String getScreenshotPath()
Description copied from interface:ConfigurationPropertiesscreenshotPath
property. Sets the filesystem path where screenshot will be saved when callingtakeScreenshot()ortakeScreenshot(String). Default value is null.- Specified by:
getScreenshotPathin interfaceConfigurationProperties- Returns:
- screenshotPath property value
-
getBrowserTimeoutRetries
public java.lang.Integer 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
public void setBrowserTimeout(java.lang.Long timeout)
Description copied from interface:ConfigurationMutatorSets the value ofbrowserTimeout
property.- Specified by:
setBrowserTimeoutin interfaceConfigurationMutator- Parameters:
timeout- property value- See Also:
ConfigurationProperties.getBrowserTimeout()
-
setRemoteUrl
public void setRemoteUrl(java.lang.String remoteUrl)
Description copied from interface:ConfigurationMutatorSets the value ofremoteUrl
property.- Specified by:
setRemoteUrlin interfaceConfigurationMutator- Parameters:
remoteUrl- property value- See Also:
ConfigurationProperties.getRemoteUrl()
-
getWebDriver
public java.lang.String getWebDriver()
Description copied from interface:ConfigurationPropertieswebDriver
property.Sets the WebDriver type to use.
When FluentLenium needs to create a new
WebDriverinstance, it callsFluentAdapter.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", "phantomjs", "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:
FluentAdapter.newWebDriver(),DefaultWebDriverFactories
-
getCustomProperty
public java.lang.String getCustomProperty(java.lang.String propertyName)
Description copied from interface:ConfigurationPropertiesGet custom property value.- Specified by:
getCustomPropertyin interfaceConfigurationProperties- Parameters:
propertyName- name of the property- Returns:
- property value
-
setDeleteCookies
public void setDeleteCookies(java.lang.Boolean deleteCookies)
Description copied from interface:ConfigurationMutatorSets the value ofdeleteCookies
property.- Specified by:
setDeleteCookiesin interfaceConfigurationMutator- Parameters:
deleteCookies- property value- See Also:
ConfigurationProperties.getDeleteCookies()
-
setEventsEnabled
public void setEventsEnabled(java.lang.Boolean eventsEnabled)
Description copied from interface:ConfigurationMutatorSets the value ofeventsEnabled
property.- Specified by:
setEventsEnabledin interfaceConfigurationMutator- Parameters:
eventsEnabled- property value
-
setHtmlDumpPath
public void setHtmlDumpPath(java.lang.String htmlDumpPath)
Description copied from interface:ConfigurationMutatorSets the value ofhtmlDumpPath
property.- Specified by:
setHtmlDumpPathin interfaceConfigurationMutator- Parameters:
htmlDumpPath- property value- See Also:
ConfigurationProperties.getHtmlDumpPath()
-
setPageLoadTimeout
public void setPageLoadTimeout(java.lang.Long pageLoadTimeout)
Description copied from interface:ConfigurationMutatorSets the value ofpageLoadTimeout
property.- Specified by:
setPageLoadTimeoutin interfaceConfigurationMutator- Parameters:
pageLoadTimeout- property value- See Also:
ConfigurationProperties.getPageLoadTimeout()
-
setScreenshotMode
public void setScreenshotMode(ConfigurationProperties.TriggerMode screenshotMode)
Description copied from interface:ConfigurationMutatorSets the value ofscreenshotMode
property.- Specified by:
setScreenshotModein interfaceConfigurationMutator- Parameters:
screenshotMode- property value- See Also:
ConfigurationProperties.getScreenshotMode()
-
getBrowserTimeout
public java.lang.Long 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
public void setBaseUrl(java.lang.String baseUrl)
Description copied from interface:ConfigurationMutatorSets the value ofbaseUrl
property.- Specified by:
setBaseUrlin interfaceConfigurationMutator- Parameters:
baseUrl- property value- See Also:
()
-
getDriverLifecycle
public ConfigurationProperties.DriverLifecycle 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
public java.lang.Long 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:
WebDriver.Timeouts.implicitlyWait(long, java.util.concurrent.TimeUnit)
-
setImplicitlyWait
public void setImplicitlyWait(java.lang.Long implicitlyWait)
Description copied from interface:ConfigurationMutatorSets the value ofimplicitlyWait
property.- Specified by:
setImplicitlyWaitin interfaceConfigurationMutator- Parameters:
implicitlyWait- property value- See Also:
ConfigurationProperties.getImplicitlyWait()
-
getCapabilities
public 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:
Capabilities, Selenium DesiredCapabilities Wiki Page
-
getScriptTimeout
public java.lang.Long 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:
WebDriver.Timeouts.setScriptTimeout(long, java.util.concurrent.TimeUnit)
-
setCapabilities
public 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:
ConfigurationProperties.getCapabilities()
-
getScreenshotMode
public ConfigurationProperties.TriggerMode 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:
ConfigurationProperties.TriggerMode
-
takeScreenshot
public void takeScreenshot(java.lang.String fileName)
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
-
asFluentList
public FluentList<FluentWebElement> asFluentList(org.openqa.selenium.WebElement... elements)
Description copied from interface:ComponentInstantiatorcreate and register a new fluent list.- Specified by:
asFluentListin interfaceComponentInstantiator- Parameters:
elements- list of elements- Returns:
- new list of fluent web element
-
goTo
public <P extends FluentPage> P goTo(P page)
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:
FluentPage.getUrl()
-
executeScript
public FluentJavascript executeScript(java.lang.String script, java.lang.Object... args)
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
public <L extends java.util.List<T>,T> L asComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass, java.lang.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
public void switchToDefault()
Description copied from interface:NavigationControlSwitch to the default element- Specified by:
switchToDefaultin interfaceNavigationControl
-
asComponentList
public <T> ComponentList<T> asComponentList(java.lang.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
public FluentList<FluentWebElement> find(org.openqa.selenium.By locator, SearchFilter... filters)
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
public void goTo(java.lang.String url)
Description copied from interface:NavigationControlOpen the url page- Specified by:
goToin interfaceNavigationControl- Parameters:
url- page URL to visit
-
switchTo
public void switchTo()
Description copied from interface:NavigationControlSwitch to the default element- Specified by:
switchToin interfaceNavigationControl
-
takeHtmlDump
public 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
public ContainerContext injectComponent(java.lang.Object componentContainer, java.lang.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
public void switchTo(FluentList<? extends FluentWebElement> elements)
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
public 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
public <L extends java.util.List<T>,T> L newComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass)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
public <T extends FluentWebElement> FluentList<T> asFluentList(java.lang.Class<T> componentClass, java.lang.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
public <T extends FluentWebElement> FluentList<T> newFluentList(java.lang.Class<T> componentClass, java.util.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
public 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:
HasCapabilities.getCapabilities()
-
newFluentList
public <T extends FluentWebElement> FluentList<T> newFluentList(java.lang.Class<T> componentClass)
Description copied from interface:ComponentInstantiatorcreate and register an empty fluent list.- 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
public <L extends java.util.List<T>,T> L newComponentList(java.lang.Class<L> listClass, java.lang.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
public FluentList<FluentWebElement> newFluentList()
Description copied from interface:ComponentInstantiatorcreate and register an empty fluent list.- Specified by:
newFluentListin interfaceComponentInstantiator- Returns:
- new list of fluent web element
-
asComponentList
public <T> ComponentList asComponentList(java.lang.Class<T> componentClass, java.lang.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
public CssSupport css()
Description copied from interface:CssControlFeatures related to CSS loaded in the active page.- Specified by:
cssin interfaceCssControl- Returns:
- Css support
-
asFluentList
public <T extends FluentWebElement> FluentList<T> asFluentList(java.lang.Class<T> componentClass, java.util.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
public FluentList<FluentWebElement> find(java.util.List<org.openqa.selenium.WebElement> rawElements)
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
public void takeHtmlDump(java.lang.String fileName)
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
public FluentList<FluentWebElement> find(java.lang.String selector, SearchFilter... filters)
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
public <T> ComponentList<T> newComponentList(java.lang.Class<T> componentClass, java.util.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:
T- type of the component- Parameters:
componentClass- type of the componentcomponentsList- components list- Returns:
- new list of components
-
asComponentList
public <L extends java.util.List<T>,T> L asComponentList(java.lang.Class<L> listClass, java.lang.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
public <T> ComponentList<T> asComponentList(java.lang.Class<T> componentClass, java.util.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
public void goToInNewTab(java.lang.String url)
Description copied from interface:NavigationControlOpen the url page in a new tab- Specified by:
goToInNewTabin interfaceNavigationControl- Parameters:
url- the url of the page
-
window
public WindowAction window()
Description copied from interface:NavigationControlExposes methods on browser window- Specified by:
windowin interfaceNavigationControl- Returns:
- Window actions
-
newComponentList
public <T> ComponentList<T> newComponentList(java.lang.Class<T> componentClass)
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
public FluentWebElement newFluent(org.openqa.selenium.WebElement element)
Description copied from interface:ComponentInstantiatorCreate and register a new fluent element from the given element.- Specified by:
newFluentin interfaceComponentInstantiator- Parameters:
element- wrapped element- Returns:
- new instance of the component
-
alert
public Alert alert()
Description copied from interface:AlertControlGet an object to control the alert window.- Specified by:
alertin interfaceAlertControl- Returns:
- an alert object
-
keyboard
public KeyboardActions keyboard()
Description copied from interface:InputControlExecute keyboard actions- Specified by:
keyboardin interfaceInputControl- Returns:
- mouse keyboard object
-
await
public FluentWait await()
Description copied from interface:AwaitControlwait for an asynchronous call- Specified by:
awaitin interfaceAwaitControl- Returns:
- FluentWait element
-
isComponentClass
public boolean isComponentClass(java.lang.Class<?> componentClass)
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
public <T> T newInstance(java.lang.Class<T> cls)
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:
FluentInjectControl.inject(Object)
-
asFluentList
public <T extends FluentWebElement> FluentList<T> asFluentList(java.lang.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
public <L extends java.util.List<T>,T> L asComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass, java.util.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
public MouseActions mouse()
Description copied from interface:InputControlExecute mouse actions- Specified by:
mousein interfaceInputControl- Returns:
- mouse actions object
-
inject
public ContainerContext inject(java.lang.Object container)
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
public void 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
-
getCookies
public java.util.Set<org.openqa.selenium.Cookie> getCookies()
Description copied from interface:NavigationControlreturn the cookies as a set- Specified by:
getCookiesin interfaceNavigationControl- Returns:
- set of cookies
-
asFluentList
public FluentList<FluentWebElement> asFluentList(java.lang.Iterable<org.openqa.selenium.WebElement> elements)
Description copied from interface:ComponentInstantiatorcreate and register a new fluent list.- Specified by:
asFluentListin interfaceComponentInstantiator- Parameters:
elements- list of elements- Returns:
- new list of fluent web element
-
getCookie
public org.openqa.selenium.Cookie getCookie(java.lang.String name)
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
public <T> ComponentList<T> newComponentList(java.lang.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:
T- type of the component- Parameters:
componentClass- type of the componentcomponentsList- components list- Returns:
- new list of components
-
find
public FluentList<FluentWebElement> find(SearchFilter... filters)
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
public FluentList<FluentWebElement> newFluentList(FluentWebElement... elements)
Description copied from interface:ComponentInstantiatorcreate and register a new fluent list.- Specified by:
newFluentListin interfaceComponentInstantiator- Parameters:
elements- list of elements- Returns:
- new list of fluent web element
-
newComponentList
public <L extends java.util.List<T>,T> L newComponentList(java.lang.Class<L> listClass, java.lang.Class<T> componentClass, java.util.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
public void switchTo(FluentWebElement element)
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
public java.lang.String pageSource()
Description copied from interface:NavigationControlReturn the source of the page- Specified by:
pageSourcein interfaceNavigationControl- Returns:
- source of the page under test
-
isComponentListClass
public boolean isComponentListClass(java.lang.Class<? extends java.util.List<?>> componentListClass)
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
public FluentList<FluentWebElement> newFluentList(java.util.List<FluentWebElement> elements)
Description copied from interface:ComponentInstantiatorcreate and register a new fluent list.- Specified by:
newFluentListin interfaceComponentInstantiator- Parameters:
elements- list of elements- Returns:
- new list of fluent web element
-
executeAsyncScript
public FluentJavascript executeAsyncScript(java.lang.String script, java.lang.Object... args)
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
public java.lang.String 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
public <T> T newComponent(java.lang.Class<T> componentClass, org.openqa.selenium.WebElement element)Description copied from interface:ComponentInstantiatorCreate and register a new component from the given element.- 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
public <T extends FluentWebElement> FluentList<T> newFluentList(java.lang.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
public FluentList<FluentWebElement> asFluentList(java.util.List<org.openqa.selenium.WebElement> elements)
Description copied from interface:ComponentInstantiatorcreate and register a new fluent list.- Specified by:
asFluentListin interfaceComponentInstantiator- Parameters:
elements- list of elements- Returns:
- new list of fluent web element
-
el
public FluentWebElement el(org.openqa.selenium.WebElement rawElement)
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
public EventsRegistry events()
Description copied from interface:EventsControlRetrieves an event registry to register event listeners.- Specified by:
eventsin interfaceEventsControl- Returns:
- the event registry.
-
-