The @FindAll annotation will take all the elements found by the various @FindBy annotations it encompasses and then returns them all in one list. Obviously only the first WebElement in the list is returned if you are populating a WebElement instead of a List. The syntax would look like this when loading it into a WebElement:
@FindAll({
@FindBy(id = "cheese"),
@FindBy(id = "crackers")
})
public WebElement cheeseAndCrackers;
Or loading into a List of WebElement's
@FindAll({
@FindBy(id = "cheese"),
@FindBy(id = "crackers")
})
public List<WebElement> cheeseAndCrackers;
It could also have been called @FindAny (and I'm happy to
change it to that if you think is sounds more descriptive, however
@FindAny doesn't sound very deterministic, it kind of implies that
you may get any element, whereas the way the elements is found is deterministic).
It is different to the existing @FindBys annotation.
The @FindBys annotation will find the first @FindBy annotation and
then try to find the second @FindBy annotation as a child of the
first one, so it really does:
driver.findElement(<By_FindByA>).findElement(<By_FindByB>).