public SearchListResultsComponent <TResultTile> Search() { WebDriverWait wait = new WebDriverWait(WebContext.WebDriver, TimeSpan.FromSeconds(10)); Stopwatch sw = new Stopwatch(); sw.Start(); AutomationSugar.ClickOn(new ByChained(this._parent.ComponentIdentifier, SimsBy.AutomationId("search_criteria_submit"))); _logger.LogLine("Waiting and clicking on search button took {0}ms.", sw.ElapsedMilliseconds); wait.Until(ExpectedConditions.ElementIsVisible(new ByChained(this._parent.ComponentIdentifier, SimsBy.AutomationId("resultTile")))); _logger.LogLine("Waiting search results took {0}ms.", sw.ElapsedMilliseconds); SearchListResultsComponent <TResultTile> results = new SearchListResultsComponent <TResultTile>(_parent); _logger.LogLine("Binding seach results tool {0}ms.", sw.ElapsedMilliseconds); sw.Stop(); return(results); }
private void Initialise() { const string resultTileIdentifier = "search_result"; var results = this.Component.FindElements(SimsBy.AutomationId(resultTileIdentifier)); foreach (var result in results) { var resultComponent = new TResultTile { Tile = result }; PageFactory.InitElements(resultComponent, new ElementLocator(result)); _results.Add(resultComponent); } }