Getting an error while trying to use @FindBy annotation in selenium Getting an error while trying to use @FindBy annotation in selenium selenium selenium

Getting an error while trying to use @FindBy annotation in selenium


See the definition of @FindBy annotation. It is applicable to fields and classes only, not to methods. It reduces the amount of code that you would otherwise need to write to locate an element and to store it into a member variable.

If you are using page object pattern, then define a member variable with this annotation. If you want to make this element available outside of your page object, implement a getter method that returns this member variable.

@FindBy(xpath="//div[@id='stateDropdown-styler']//div[@class='jq-selectbox__trigger']")private WebElement clickProvinceDropDownArrow;public WebElement getClickProvinceDropDownArrow() {    return clickProvinceDropDownArrow;}