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 elementswebelement(s) more then once your code gets better readable.What are the advantages of Page Factory that I'm missing?
You also can use different kind ofsome attributes with the Page Factory. LikeThe most obvious is the FindsBy attribute but you can also use the CacheLookup attribute to cache the element once it is looked up once.
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 elements more then once your code gets better readable.What are the advantages of Page Factory that I'm missing?
You also can use different kind of attributes. Like the CacheLookup attribute to cache the element once it is looked up once.
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.
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 elements more then once your code gets better readable.What are the advantages of Page Factory that I'm missing?
You also can use different kind of attributes. Like the CacheLookup attribute to cache the element once it is looked up once.