I was using for a long time PageFactory (in Java). Now writing tests in .NET I found out it's deprecated.
Right now I just initialize all page objects when application starts using [BeforeScenario] SpecFlow annotation.
So it looks like this:
[BeforeScenario]
public void Setup()
{
// initialize driver and some other stuff code
_session = new WebDriver();
// initialize PageObjects
MainView = new MainView(_session);
OtherView = new OtherView(_session);
// and so on...
}
It works fine, up to the moment where framework grows to hundreds of Page Objects. I feel that there should be better way to do that.
Can you provide here your solutions to handle a lot of PageObjects withouth PageFactory in .NET?