I am a new test engineer and have been reading about Page Object Model and implementing them and keep coming across Page Factory. I understand that Page Factory is a POM tha
Why do I want to instantiate all the elements instead of doing it on the fly?
The PageFactory can be used to initialize elements of a Page class without having to use FindElement or FindElements. When you are using the webelement(s) more then once your code gets better readable.
What are the advantages of Page Factory that I'm missing?
You also can use some attributes with the Page Factory. The most obvious is the FindsBy attribute but you can also use the CacheLookup attribute to cache the element once it is looked up once.