Reputation: 265
Can anybody tell me how to use explicit wait using pagefactory for a collection of webelements ?
[FindsBy(How = How.ClassName, Using = "tree-item-content")]
public IList<IWebElement> TreeItems { get; set; }
Upvotes: 3
Views: 728
Reputation: 265
This solves my issue let me know if this is not a good way to solve the problem
WebDriverWait wait = new WebDriverWait(Driver.WebDriver,TimeSpan.FromSeconds(20));
wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(new ReadOnlyCollection<IWebElement>(TreeItems)));
Upvotes: 3