How do I correctly implement PageFactory annotations within Selenium? How do I correctly implement PageFactory annotations within Selenium? selenium selenium

How do I correctly implement PageFactory annotations within Selenium?


You have an error in your syntax:

    @FindBy(css = "#Rabo_SelectedBatchSLTransactionrow0 > * > [type = 'checkbox']")    public WebElement firstAlertCheckboxSelected();

firstAlerchCheckboxSelected is NOT a method. It's a variable.

Change it to:

    @FindBy(css = "#Rabo_SelectedBatchSLTransactionrow0 > * > [type = 'checkbox']")    public WebElement firstAlertCheckboxSelected;