public class UiElementCollection extends AbstractList<UiElement>
UiElement
and provides a new functionality.
$$(".errorMessage").first()shouldBe(visible, enabled);
$$("td").shouldHaveSize(5);
$$(".edit").getTexts();
List
Modifier and Type | Method and Description |
---|---|
static String |
elementsToString(List<? extends org.openqa.selenium.WebElement> elements)
Outputs string presentation of the element's collection
|
UiElementCollection |
exclude(UiCondition condition)
Filters elements excluding those which met the given condition
|
UiElementCollection |
excludeWith(UiCondition condition)
Filters elements excluding those which met the given condition
|
UiElementCollection |
filter(UiCondition condition)
Filters collection elements based on the given condition
|
UiElementCollection |
filterBy(UiCondition condition)
Filters collection elements based on the given condition
|
UiElement |
find(UiCondition condition)
Find the first element which met the given condition
|
UiElement |
findBy(UiCondition condition)
Find the first element which met the given condition
|
UiElement |
first() |
UiElement |
get(int index) |
String[] |
getTexts()
Gets all the texts in elements collection
|
static String[] |
getTexts(Collection<? extends org.openqa.selenium.WebElement> elements)
Fail-safe method for retrieving texts of given elements.
|
Iterator<UiElement> |
iterator() |
UiElement |
last() |
ListIterator<UiElement> |
listIterator() |
ListIterator<UiElement> |
listIterator(int index) |
UiElementCollection |
shouldBe(UiCollectionCondition... conditions)
$$(".error").shouldBe(empty)
|
UiElementCollection |
shouldHave(UiCollectionCondition... conditions)
$$(".error").shouldHave(size(3))
|
UiElementCollection |
shouldHaveSize(int expectedSize)
Checks is the collection is of given size
|
int |
size() |
String |
toString() |
UiElementCollection |
waitUntil(UiCollectionCondition condition)
Wait until given collection meets given conditions.
|
UiElementCollection |
waitUntil(UiCollectionCondition condition,
long timeoutMilliseconds)
Wait until given collection meets given conditions.
|
UiElementCollection |
waitUntil(UiCollectionCondition condition,
long timeoutMilliseconds,
long pollingIntervalMilliseconds)
Wait until given collection meets given conditions.
|
UiElementCollection |
waitWhile(UiCollectionCondition condition)
Wait while given collection meets given conditions.
|
UiElementCollection |
waitWhile(UiCollectionCondition condition,
long timeoutMilliseconds)
Wait while given collection meets given conditions.
|
UiElementCollection |
waitWhile(UiCollectionCondition condition,
long timeoutMilliseconds,
long pollingIntervalMilliseconds)
Wait while given collection meets given conditions.
|
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, remove, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public UiElement get(int index)
public UiElement first()
public UiElement last()
public int size()
size
in interface Collection<UiElement>
size
in interface List<UiElement>
size
in class AbstractCollection<UiElement>
public UiElementCollection shouldHaveSize(int expectedSize)
expectedSize
- expected size of the collectionpublic UiElementCollection shouldBe(UiCollectionCondition... conditions)
public UiElementCollection shouldHave(UiCollectionCondition... conditions)
public UiElementCollection waitUntil(UiCollectionCondition condition)
Wait until given collection meets given conditions.
IllegalStateException
- if collection still is not matched to condition after the timeoutpublic UiElementCollection waitUntil(UiCollectionCondition condition, long timeoutMilliseconds)
Wait until given collection meets given conditions.
timeoutMilliseconds
- timeout in milliseconds.IllegalStateException
- if collection still is not matched to condition after the timeoutpublic UiElementCollection waitUntil(UiCollectionCondition condition, long timeoutMilliseconds, long pollingIntervalMilliseconds)
Wait until given collection meets given conditions.
timeoutMilliseconds
- timeout in milliseconds.pollingIntervalMilliseconds
- interval in milliseconds, when checking conditionIllegalStateException
- if collection still is not matched to condition after the timeoutpublic UiElementCollection waitWhile(UiCollectionCondition condition)
Wait while given collection meets given conditions.
IllegalStateException
- if collection still is not matched to condition after the timeoutpublic UiElementCollection waitWhile(UiCollectionCondition condition, long timeoutMilliseconds)
Wait while given collection meets given conditions.
timeoutMilliseconds
- timeout in milliseconds.IllegalStateException
- if collection still is not matched to condition after the timeoutpublic UiElementCollection waitWhile(UiCollectionCondition condition, long timeoutMilliseconds, long pollingIntervalMilliseconds)
Wait while given collection meets given conditions.
timeoutMilliseconds
- timeout in milliseconds.pollingIntervalMilliseconds
- interval in milliseconds, when checking conditionIllegalStateException
- if collection still is not matched to condition after the timeoutpublic UiElementCollection filter(UiCondition condition)
condition
- public UiElementCollection filterBy(UiCondition condition)
condition
- filter(UiCondition)
public UiElementCollection exclude(UiCondition condition)
condition
- public UiElementCollection excludeWith(UiCondition condition)
condition
- exclude(UiCondition)
public UiElement find(UiCondition condition)
condition
- public UiElement findBy(UiCondition condition)
condition
- find(UiCondition)
public String[] getTexts()
public static String[] getTexts(Collection<? extends org.openqa.selenium.WebElement> elements)
elements
- Any collection of WebElementspublic static String elementsToString(List<? extends org.openqa.selenium.WebElement> elements)
elements
- public ListIterator<UiElement> listIterator()
listIterator
in interface List<UiElement>
listIterator
in class AbstractList<UiElement>
public ListIterator<UiElement> listIterator(int index)
listIterator
in interface List<UiElement>
listIterator
in class AbstractList<UiElement>
public String toString()
toString
in class AbstractCollection<UiElement>
Copyright 2016, WorkFusion, Inc.