Hi Shruti, The PageFactory class in Selenium is an extension to the Page Object design pattern. It is used to initialize the elements of the Page Object or instantiate the Page Objects itself. It is used to initialize elements of a Page class without having to use ‘FindElement’ or ‘FindElements’. Annotations can be used to supply descriptive names of target objects to improve code readability. Java implementation provide greater flexibility with PageFactory.
Additionally, with the help of the PageFactory in Selenium class, we can use annotations @FindBy to find WebElement.