Package com.codeborne.selenide.appium
Class SelenideAppiumCollection
java.lang.Object
com.codeborne.selenide.BaseElementsCollection<SelenideElement,ElementsCollection>
com.codeborne.selenide.ElementsCollection
com.codeborne.selenide.appium.SelenideAppiumCollection
- All Implemented Interfaces:
Iterable<SelenideElement>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.codeborne.selenide.BaseElementsCollection
BaseElementsCollection.SelenideElementIterable<T extends SelenideElement> -
Constructor Summary
ConstructorsConstructorDescriptionSelenideAppiumCollection(WebElementSource parent, org.openqa.selenium.By selector) -
Method Summary
Modifier and TypeMethodDescriptionGive this collection a human-readable nameprotected SelenideAppiumCollectioncreate(CollectionSource source) exclude(WebElementCondition condition) Filters elements excluding those which met the given condition (lazy evaluation)excludeWith(WebElementCondition condition) Filters elements excluding those which met the given condition (lazy evaluation)filter(WebElementCondition condition) Filters collection elements based on the given condition (lazy evaluation)filterBy(WebElementCondition condition) Filters collection elements based on the given condition (lazy evaluation)find(WebElementCondition condition) Find the first element which met the given condition (lazy evaluation)findBy(WebElementCondition condition) Find the first element which met the given condition (lazy evaluation)first()returns the first element of the collection (lazy evaluation)first(int elements) returns the first n elements of the collection (lazy evaluation)get(int index) Gets the n-th element of collection (lazy evaluation)last()returns the last element of the collection (lazy evaluation)last(int elements) returns the last n elements of the collection (lazy evaluation)should(WebElementsCondition... conditions) Check if a collection matches given condition(s).should(WebElementsCondition condition, Duration timeout) Check if a collection matches a given condition within the given time period.shouldBe(WebElementsCondition... conditions) For example:$$(".error").shouldBe(empty)shouldBe(WebElementsCondition condition, Duration timeout) shouldHave(WebElementsCondition... conditions) For example:$$(".error").shouldHave(size(3))$$(".error").shouldHave(texts("Error1", "Error2"))shouldHave(WebElementsCondition condition, Duration timeout) Check if a collection matches given condition within given periodsnapshot()Takes the snapshot of current state of this collection.Methods inherited from class com.codeborne.selenide.BaseElementsCollection
asDynamicIterable, asFixedIterable, attributes, describe, isEmpty, iterator, should, size, stream, texts, toString, waitUntilMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SelenideAppiumCollection
-
-
Method Details
-
create
- Overrides:
createin classElementsCollection
-
should
Description copied from class:BaseElementsCollectionCheck if a collection matches given condition(s).For example:
$$(".text_list").should(containExactTextsCaseSensitive("text1", "text2")); $$(".cat_list").should(allMatch("value==cat", el -> el.getAttribute("value").equals("cat")));- Overrides:
shouldin classBaseElementsCollection<SelenideElement,ElementsCollection>
-
should
@CanIgnoreReturnValue public SelenideAppiumCollection should(WebElementsCondition condition, Duration timeout) Description copied from class:BaseElementsCollectionCheck if a collection matches a given condition within the given time period.- Overrides:
shouldin classBaseElementsCollection<SelenideElement,ElementsCollection> timeout- maximum waiting time
-
shouldBe
Description copied from class:BaseElementsCollectionFor example:$$(".error").shouldBe(empty)- Overrides:
shouldBein classBaseElementsCollection<SelenideElement,ElementsCollection>
-
shouldBe
@CanIgnoreReturnValue public SelenideAppiumCollection shouldBe(WebElementsCondition condition, Duration timeout) - Overrides:
shouldBein classBaseElementsCollection<SelenideElement,ElementsCollection>
-
shouldHave
@CanIgnoreReturnValue public SelenideAppiumCollection shouldHave(WebElementsCondition... conditions) Description copied from class:BaseElementsCollectionFor example:$$(".error").shouldHave(size(3))$$(".error").shouldHave(texts("Error1", "Error2"))- Overrides:
shouldHavein classBaseElementsCollection<SelenideElement,ElementsCollection>
-
shouldHave
@CanIgnoreReturnValue public SelenideAppiumCollection shouldHave(WebElementsCondition condition, Duration timeout) Description copied from class:BaseElementsCollectionCheck if a collection matches given condition within given period- Overrides:
shouldHavein classBaseElementsCollection<SelenideElement,ElementsCollection> timeout- maximum waiting time
-
filter
Description copied from class:BaseElementsCollectionFilters collection elements based on the given condition (lazy evaluation)- Overrides:
filterin classBaseElementsCollection<SelenideElement,ElementsCollection> - Parameters:
condition- condition- Returns:
- ElementsCollection
- See Also:
-
filterBy
Description copied from class:BaseElementsCollectionFilters collection elements based on the given condition (lazy evaluation)- Overrides:
filterByin classBaseElementsCollection<SelenideElement,ElementsCollection> - Parameters:
condition- condition- Returns:
- ElementsCollection
- See Also:
-
exclude
Description copied from class:BaseElementsCollectionFilters elements excluding those which met the given condition (lazy evaluation)- Overrides:
excludein classBaseElementsCollection<SelenideElement,ElementsCollection> - Parameters:
condition- condition- Returns:
- ElementsCollection
- See Also:
-
excludeWith
Description copied from class:BaseElementsCollectionFilters elements excluding those which met the given condition (lazy evaluation)- Overrides:
excludeWithin classBaseElementsCollection<SelenideElement,ElementsCollection> - Parameters:
condition- condition- Returns:
- ElementsCollection
- See Also:
-
first
Description copied from class:BaseElementsCollectionreturns the first n elements of the collection (lazy evaluation)- Overrides:
firstin classBaseElementsCollection<SelenideElement,ElementsCollection> - Parameters:
elements- number of elements 1…N- See Also:
-
last
Description copied from class:BaseElementsCollectionreturns the last n elements of the collection (lazy evaluation)- Overrides:
lastin classBaseElementsCollection<SelenideElement,ElementsCollection> - Parameters:
elements- number of elements 1…N- See Also:
-
snapshot
Description copied from class:BaseElementsCollectionTakes the snapshot of current state of this collection. Succeeding calls to this object WILL NOT RELOAD collection element from browser.Use it to speed up your tests - but only if you know that collection will not be changed during the test.
- Overrides:
snapshotin classBaseElementsCollection<SelenideElement,ElementsCollection> - Returns:
- current state of this collection
- See Also:
-
as
Description copied from class:BaseElementsCollectionGive this collection a human-readable nameCaution: you probably don't need this method. It's always a good idea to have the actual selector instead of "nice" description (which might be misleading or even lying).
- Overrides:
asin classBaseElementsCollection<SelenideElement,ElementsCollection> - Parameters:
alias- a human-readable name of this collection (null or empty string not allowed)- Returns:
- this collection
-
get
Description copied from class:BaseElementsCollectionGets the n-th element of collection (lazy evaluation)- Overrides:
getin classBaseElementsCollection<SelenideElement,ElementsCollection> - Parameters:
index- 0..N- Returns:
- the n-th element of collection
- See Also:
-
first
Description copied from class:BaseElementsCollectionreturns the first element of the collection (lazy evaluation)
NOTICE: Instead of
$$(css).first(), prefer$(css)as it's faster and returns the same result- Overrides:
firstin classBaseElementsCollection<SelenideElement,ElementsCollection> - Returns:
- the first element of the collection
- See Also:
-
last
Description copied from class:BaseElementsCollectionreturns the last element of the collection (lazy evaluation)- Overrides:
lastin classBaseElementsCollection<SelenideElement,ElementsCollection> - Returns:
- the last element of the collection
- See Also:
-
find
Description copied from class:BaseElementsCollectionFind the first element which met the given condition (lazy evaluation)- Overrides:
findin classBaseElementsCollection<SelenideElement,ElementsCollection> - Parameters:
condition- condition- Returns:
- SelenideElement
- See Also:
-
findBy
Description copied from class:BaseElementsCollectionFind the first element which met the given condition (lazy evaluation)- Overrides:
findByin classBaseElementsCollection<SelenideElement,ElementsCollection> - Parameters:
condition- condition- Returns:
- SelenideElement
- See Also:
-