org.fluentlenium.core
Class Fluent

java.lang.Object
  extended by org.fluentlenium.core.Fluent
All Implemented Interfaces:
SearchActions
Direct Known Subclasses:
FillConstructor, FluentAdapter, FluentPage

public abstract class Fluent
extends Object
implements SearchActions

Util Class which offers some shortcut to webdriver methods


Constructor Summary
Fluent()
           
Fluent(org.openqa.selenium.WebDriver driver)
           
 
Method Summary
 FluentList<FluentWebElement> $(String name, Filter... filters)
          Central methods to find elements on the page.
 FluentWebElement $(String name, Integer number, Filter... filters)
          Central methods a find element on the page, the number indicat the index of the desired element on the list.
 FluentWait await()
          wait for an asynchronous call
 Fluent clear(FluentList<FluentWebElement> fluentObject)
          Clear all elements that are in the list Be careful - only the visible elements are cleared
 Fluent clear(FluentWebElement fluentObject)
          Clear the given parameters elements that are in the list Be careful - only the visible elements are cleared
 Fluent clear(String cssSelector, Filter... filters)
          Submit all elements that are in cssSelector with its filters Be careful - only the visible elements are cleared
 Fluent click(FluentDefaultActions fluentObject)
          click all elements that are in the list Be careful - only the visible elements are clicked
 Fluent click(String cssSelector, Filter... filters)
          click all elements that are in cssSelector with its filters Be careful - only the visible elements are clicked
 Fluent executeScript(String script)
           
 FillConstructor fill(FluentDefaultActions list, Filter... filters)
          Construct a FillConstructor in order to allow easy fill Be careful - only the visible elements are filled
 FillConstructor fill(String cssSelector, Filter... filters)
          Construct a FillConstructor in order to allow easy fill Be careful - only the visible elements are filled
 FluentList<FluentWebElement> find(String name, Filter... filters)
          return the lists corresponding to the cssSelector with it filters
 FluentWebElement find(String name, Integer number, Filter... filters)
          Return the elements at the numner position into the the lists corresponding to the cssSelector with it filters
 FluentWebElement findFirst(String name, Filter... filters)
          Return the first elements corresponding to the name and the filters
 String getBaseUrl()
          Get the base URL to use when visiting relative URLs, if one is configured
 org.openqa.selenium.Cookie getCookie(String name)
          return the corresponding cookie given a name
 Set<org.openqa.selenium.Cookie> getCookies()
          return the cookies as a set
 org.openqa.selenium.WebDriver getDriver()
           
<P extends FluentPage>
P
goTo(P page)
           
 Fluent goTo(String url)
          Open the url page
protected  Fluent initFluent(org.openqa.selenium.WebDriver driver)
           
 String pageSource()
          Return the source of the page
 Fluent submit(FluentDefaultActions fluentObject)
          Submit all elements that are in the list Be careful - only the visible elements are submitted
 Fluent submit(String cssSelector, Filter... filters)
          Submit all elements that are in cssSelector with its filters Be careful - only the visible elements are submitted
 Fluent takeScreenShot()
          Take a snapshot of the browser.
 Fluent takeScreenShot(String fileName)
          Take a snapshot of the browser into a file given by the fileName param.
 List<String> text(String cssSelector, Filter... filters)
          get a list all elements that are in cssSelector with its filters Be careful - only the visible elements are submitted //TODO UTILITY ? Deprecated ?
 String title()
          Return the title of the page
 String url()
          Return the url of the page
 List<String> value(String cssSelector, Filter... filters)
          Value all elements that are in cssSelector with its filters Be careful - only the visible elements are returned //TODO UTILITY ? Deprecated ?
 Fluent withDefaultPageWait(long l, TimeUnit timeUnit)
          Define an implicit time to wait for a page to be loaded
 Fluent withDefaultSearchWait(long l, TimeUnit timeUnit)
          Define an implicit time to wait when searching an element
 Fluent withDefaultUrl(String baseUrl)
          Defined the default url that will be used in the test and in the relative pages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fluent

public Fluent(org.openqa.selenium.WebDriver driver)

Fluent

public Fluent()
Method Detail

withDefaultUrl

public Fluent withDefaultUrl(String baseUrl)
Defined the default url that will be used in the test and in the relative pages

Parameters:
baseUrl -
Returns:

withDefaultPageWait

public Fluent withDefaultPageWait(long l,
                                  TimeUnit timeUnit)
Define an implicit time to wait for a page to be loaded

Parameters:
l -
timeUnit -
Returns:

withDefaultSearchWait

public Fluent withDefaultSearchWait(long l,
                                    TimeUnit timeUnit)
Define an implicit time to wait when searching an element

Parameters:
l -
timeUnit -
Returns:

takeScreenShot

public Fluent takeScreenShot()
Take a snapshot of the browser. By default the file will be a png named by the current timestamp.


takeScreenShot

public Fluent takeScreenShot(String fileName)
Take a snapshot of the browser into a file given by the fileName param.

Parameters:
fileName -

initFluent

protected final Fluent initFluent(org.openqa.selenium.WebDriver driver)

getDriver

public org.openqa.selenium.WebDriver getDriver()

getBaseUrl

public String getBaseUrl()
Get the base URL to use when visiting relative URLs, if one is configured

Returns:
The base URL, or null if none configured

await

public FluentWait await()
wait for an asynchronous call

Returns:

title

public String title()
Return the title of the page

Returns:

getCookies

public Set<org.openqa.selenium.Cookie> getCookies()
return the cookies as a set

Returns:

getCookie

public org.openqa.selenium.Cookie getCookie(String name)
return the corresponding cookie given a name

Parameters:
name -
Returns:

url

public String url()
Return the url of the page

Returns:

pageSource

public String pageSource()
Return the source of the page

Returns:

goTo

public <P extends FluentPage> P goTo(P page)

goTo

public Fluent goTo(String url)
Open the url page

Parameters:
url -

executeScript

public Fluent executeScript(String script)

$

public FluentList<FluentWebElement> $(String name,
                                      Filter... filters)
Central methods to find elements on the page. Can provide some filters. Able to use css1, css2, css3, see WebDriver restrictions

Parameters:
name -
filters -
Returns:

$

public FluentWebElement $(String name,
                          Integer number,
                          Filter... filters)
Central methods a find element on the page, the number indicat the index of the desired element on the list. Can provide some filters. Able to use css1, css2, css3, see WebDriver restrictions

Parameters:
name -
filters -
Returns:

find

public FluentList<FluentWebElement> find(String name,
                                         Filter... filters)
return the lists corresponding to the cssSelector with it filters

Specified by:
find in interface SearchActions
Parameters:
name -
filters -
Returns:

find

public FluentWebElement find(String name,
                             Integer number,
                             Filter... filters)
Return the elements at the numner position into the the lists corresponding to the cssSelector with it filters

Specified by:
find in interface SearchActions
Parameters:
name -
number -
filters -
Returns:

findFirst

public FluentWebElement findFirst(String name,
                                  Filter... filters)
Return the first elements corresponding to the name and the filters

Specified by:
findFirst in interface SearchActions
Parameters:
name -
filters -
Returns:

fill

public FillConstructor fill(String cssSelector,
                            Filter... filters)
Construct a FillConstructor in order to allow easy fill Be careful - only the visible elements are filled

Parameters:
cssSelector -

fill

public FillConstructor fill(FluentDefaultActions list,
                            Filter... filters)
Construct a FillConstructor in order to allow easy fill Be careful - only the visible elements are filled

Parameters:
list -

click

public Fluent click(String cssSelector,
                    Filter... filters)
click all elements that are in cssSelector with its filters Be careful - only the visible elements are clicked

Parameters:
cssSelector -

clear

public Fluent clear(String cssSelector,
                    Filter... filters)
Submit all elements that are in cssSelector with its filters Be careful - only the visible elements are cleared

Parameters:
cssSelector -

submit

public Fluent submit(String cssSelector,
                     Filter... filters)
Submit all elements that are in cssSelector with its filters Be careful - only the visible elements are submitted

Parameters:
cssSelector -

text

public List<String> text(String cssSelector,
                         Filter... filters)
get a list all elements that are in cssSelector with its filters Be careful - only the visible elements are submitted //TODO UTILITY ? Deprecated ?

Parameters:
cssSelector -

value

public List<String> value(String cssSelector,
                          Filter... filters)
Value all elements that are in cssSelector with its filters Be careful - only the visible elements are returned //TODO UTILITY ? Deprecated ?

Parameters:
cssSelector -

click

public Fluent click(FluentDefaultActions fluentObject)
click all elements that are in the list Be careful - only the visible elements are clicked

Parameters:
fluentObject -

clear

public Fluent clear(FluentList<FluentWebElement> fluentObject)
Clear all elements that are in the list Be careful - only the visible elements are cleared

Parameters:
fluentObject -

clear

public Fluent clear(FluentWebElement fluentObject)
Clear the given parameters elements that are in the list Be careful - only the visible elements are cleared

Parameters:
fluentObject -

submit

public Fluent submit(FluentDefaultActions fluentObject)
Submit all elements that are in the list Be careful - only the visible elements are submitted

Parameters:
fluentObject -


Copyright © 2012 AConsulting. All Rights Reserved.