public static bool KeyDownNavigationOnPupilResults(SeleniumHelper.iSIMSUserType user) { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(user); SearchResultTile srt = searchBox.EnterSearchTextForPupils("ad"); int resultCount = srt.tileCount(); bool traversed = false; Actions action = new Actions(WebContext.WebDriver); action.SendKeys(Keys.Tab).Perform(); action.SendKeys(Keys.Tab).Perform(); for (var index = 0; index < resultCount; index++) { action.SendKeys(OpenQA.Selenium.Keys.Down).Perform(); String classNameForStrongTags = srt.getClassForStrongname(index); if (classNameForStrongTags.Contains("tt-selectable")) { traversed = true; } else { return(false); } } return(traversed); }
public void KeyUpNavigationOnPupilResults() { AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(); SearchResultTile srt = searchBox.EnterSearchTextForPupils(textForSearch); int resultCount = srt.tileCount(); Actions action = new Actions(WebContext.WebDriver); action.SendKeys(Keys.Tab).Perform(); action.SendKeys(Keys.Tab).Perform(); for (var index = 0; index < resultCount; index++) { action.SendKeys(OpenQA.Selenium.Keys.Down).Perform(); } for (var i = resultCount - 2; i >= 0; i--) { action.SendKeys(OpenQA.Selenium.Keys.Up).Perform(); String classNameForStrongTags = srt.getClassForStrongname(i); Assert.That(classNameForStrongTags.Contains("tt-selectable")); } }