appium/java-client — pull request #126 by TikhomirovSergey (2014-10-12 21:21:27+00:00)
Title: #122 Fix

**@AndroidFindAll** and **@iOSFindAll** have been added.

So if the same app for the same platform has almost similar screens (there could be minor differences) it doesn't need to implement page/screen objects for each situation. It can be implemented once!

```java
@AndroidFindAll({@AndroidFindBy(locator1), @AndroidFindBy(locator2)}) //element will be found by any
WebElement someElement; //of declared locators
```

```java
@AndroidFindAll({@AndroidFindBy(locator1), @AndroidFindBy(locator2)}) //it creates an element collection
List someElements; //using all declared locators
```

or

```java
@iOSFindAll({@iOSFindBy(locator1), @iOSFindBy(locator2)}) //element will be found by any
WebElement someElement; //of declared locators
```

```java
@AndroidFindAll({@iOSFindBy(locator1), @iOSFindBy(locator2)}) //it creates an element collection
List someElements; //using all declared locators
```

All declared locators will be checked inside one time frame (not the same time frame for each locator, one time frame for all locators at one time). So there shouldn't be performance issues.

There is one more bonus.
(1)
```java
//there is no annotation
WebElement someElementId; //this element will be found by id or name which equal "someElementId"
```

(2)

```java
//there is no annotation
List someElementId; //it is supposed that elements will be found by id or name which equal "someElementId"
```

Actially (1) works and (2) will be reason of NullPointerException if common Selenium tools are used (DefaultFieldDecorator). With AppiumFieldDecorator both use cases are fine.