If @FindBy returns no element, do we get error as I saw @FindBy could be used to get 0 to multiple elements.
Scenario: @FindBy(id = "btn") private WebElement searchButton; //allows single element to be referenced
Case 1: If we have no elements having id as "btn", then what would be the result? Case 2: If we have multiple elements having id as "btn",then what would be the result?
Please clarify.
You won't receive an error when calling
PageFactory.initElements, element that wasn't found will be set tonull. However you will getNullPointerExceptionwhen you try to use the element.