Skip to content

Commit f9cd5bb

Browse files
authored
refactor: Deprecate Appium ByAll (#1740)
Appium `io.appium.java_client.pagefactory.bys.builder.ByAll` was implemented as an extension of Selenium `org.openqa.selenium.support.pagefactory.ByAll` and introduced a performance improvement: "By All was re-implemented, now it returns the first founded element for single search." (#686 on 3 Aug 2017). However Selenium team introduced the same performance fix "SeleniumHQ/selenium@18028ac ByAll.findElement should not not use remaining locators if an element is already found" on 7 Sep 2017. So there is no reason to keep Appium `ByAll`, this commit deprecates it.
1 parent ab3fc19 commit f9cd5bb

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/main/java/io/appium/java_client/pagefactory/DefaultElementByBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import io.appium.java_client.pagefactory.bys.ContentMappedBy;
2424
import io.appium.java_client.pagefactory.bys.ContentType;
2525
import io.appium.java_client.pagefactory.bys.builder.AppiumByBuilder;
26-
import io.appium.java_client.pagefactory.bys.builder.ByAll;
2726
import io.appium.java_client.pagefactory.bys.builder.ByChained;
2827
import io.appium.java_client.pagefactory.bys.builder.HowToUseSelectors;
2928
import org.openqa.selenium.By;
@@ -32,6 +31,7 @@
3231
import org.openqa.selenium.support.FindAll;
3332
import org.openqa.selenium.support.FindBy;
3433
import org.openqa.selenium.support.FindBys;
34+
import org.openqa.selenium.support.pagefactory.ByAll;
3535

3636
import java.lang.annotation.Annotation;
3737
import java.lang.reflect.AnnotatedElement;

src/main/java/io/appium/java_client/pagefactory/bys/builder/AppiumByBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import org.openqa.selenium.By;
2626
import org.openqa.selenium.support.pagefactory.AbstractAnnotations;
27+
import org.openqa.selenium.support.pagefactory.ByAll;
2728

2829
import javax.annotation.Nullable;
2930
import java.lang.annotation.Annotation;

src/main/java/io/appium/java_client/pagefactory/bys/builder/ByAll.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,20 @@
1313
import java.util.Optional;
1414
import java.util.function.Function;
1515

16-
16+
/**
17+
* Mechanism used to locate elements within a document using a series of lookups. This class will
18+
* find all DOM elements that matches any of the locators in sequence, e.g.
19+
*
20+
* <pre>
21+
* driver.findElements(new ByAll(by1, by2))
22+
* </pre>
23+
*
24+
* will find all elements that match <var>by1</var> and then all elements that match <var>by2</var>.
25+
* This means that the list of elements returned may not be in document order.
26+
*
27+
* @deprecated Use {@link org.openqa.selenium.support.pagefactory.ByAll}
28+
*/
29+
@Deprecated
1730
public class ByAll extends org.openqa.selenium.support.pagefactory.ByAll {
1831

1932
private final List<By> bys;

0 commit comments

Comments
 (0)