When I use PageObject and I want to set a time to wait for elements on the page then I use ImplicitlyWait:
Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(3));
This means that when my page object is initializing:
PageFactory.InitElements(Driver, this);
Then it will wait for elements not less then 3 seconds.
Also there is another feature of Selenium that I discovered recently: RetryingElementLocator class
Code of this class: https://seleniumhq.github.io/selenium/docs/api/dotnet/html/T_OpenQA_Selenium_Support_PageObjects_RetryingElementLocator.htm
As I understand it allows to set time to wait elements on a page for PageObject.
The example of usage is the next:
IWebDriver driver = new ChromeDriver();
RetryingElementLocator retry = new RetryingElementLocator(driver, TimeSpan.FromSeconds(5));
IPageObjectMemberDecorator decor = new DefaultPageObjectMemberDecorator();
PageFactory.InitElements(retry.SearchContext, this, decor);
So the question is: if there is any difference between 2 methods and if so when it's better to use the second one?