org.fluentlenium.core.domain
Class FluentList<E extends FluentWebElement>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<E>
              extended by org.fluentlenium.core.domain.FluentList<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, FluentDefaultActions<FluentList>, SearchActions

public class FluentList<E extends FluentWebElement>
extends ArrayList<E>
implements FluentDefaultActions<FluentList>, SearchActions

Map the list to a FluentList in order to offers some events like click(), submit(), value() ...

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
FluentList(Collection<E> listFiltered)
           
 
Method Summary
 void clear()
          Clear all elements on the list Only the visible elements are filled
 FluentList clearAll()
          Clear all elements on the list Only the visible elements are filled
 FluentList click()
          Click on all elements on the list Only the visible elements are filled
 FluentList find(String name, Filter... filters)
          find elements into the childs with the corresponding filters
 E find(String name, Integer number, Filter... filters)
          find elements into the childs with the corresponding filters at the position indicated by the number
 E findFirst(String name, Filter... filters)
          find elements into the childs with the corresponding filters at the first position
 E first()
          Return the first element of the list If none, return NoSuchElementException
 String getAttribute(String attribute)
          Return a custom attribute of the first element on the list
 List<String> getAttributes(String attribute)
          Return a custom attribute of elements on the list
 String getId()
          Return the id of the first element on the list
 List<String> getIds()
          Return the id of elements on the list
 String getName()
          Return the name of the first element on the list
 List<String> getNames()
          Return the name of elements on the list
 String getText()
          Return the text of the first element on the list
 List<String> getTexts()
          Return the texts of list elements
 String getValue()
          Return the value of the first element in the list
 List<String> getValues()
          Return the value of elements on the list
 FluentList submit()
          submit on all elements on the list Only the visible elements are submitted
 FluentList text(String... with)
          Fill all elements on the list with the corresponding cell in the with table.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

FluentList

public FluentList(Collection<E> listFiltered)
Method Detail

first

public E first()
Return the first element of the list If none, return NoSuchElementException

Returns:
Throws:
org.openqa.selenium.NoSuchElementException

click

public FluentList click()
Click on all elements on the list Only the visible elements are filled

Specified by:
click in interface FluentDefaultActions<FluentList>

text

public FluentList text(String... with)
Fill all elements on the list with the corresponding cell in the with table. Only the visible elements are filled If there is more elements on the list than in the with table, the last element of the table is repeated

Specified by:
text in interface FluentDefaultActions<FluentList>

clearAll

public FluentList clearAll()
Clear all elements on the list Only the visible elements are filled


clear

public void clear()
Clear all elements on the list Only the visible elements are filled

Specified by:
clear in interface Collection<E extends FluentWebElement>
Specified by:
clear in interface List<E extends FluentWebElement>
Overrides:
clear in class ArrayList<E extends FluentWebElement>

submit

public FluentList submit()
submit on all elements on the list Only the visible elements are submitted

Specified by:
submit in interface FluentDefaultActions<FluentList>

getValues

public List<String> getValues()
Return the value of elements on the list

Returns:

getIds

public List<String> getIds()
Return the id of elements on the list

Returns:

getAttributes

public List<String> getAttributes(String attribute)
Return a custom attribute of elements on the list

Returns:

getNames

public List<String> getNames()
Return the name of elements on the list

Returns:

getTexts

public List<String> getTexts()
Return the texts of list elements

Returns:

getValue

public String getValue()
Return the value of the first element in the list

Returns:

getId

public String getId()
Return the id of the first element on the list

Returns:

getAttribute

public String getAttribute(String attribute)
Return a custom attribute of the first element on the list

Returns:

getName

public String getName()
Return the name of the first element on the list

Returns:

getText

public String getText()
Return the text of the first element on the list

Returns:

find

public FluentList find(String name,
                       Filter... filters)
find elements into the childs with the corresponding filters

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

find

public E find(String name,
              Integer number,
              Filter... filters)
find elements into the childs with the corresponding filters at the position indicated by the number

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

findFirst

public E findFirst(String name,
                   Filter... filters)
find elements into the childs with the corresponding filters at the first position

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


Copyright © 2012 AConsulting. All Rights Reserved.