public void ClickFavFood() { List <IWebElement> listElements = SiteDriver.FindElements(_demoPage.favFood, How.CssSelector); foreach (IWebElement e in listElements) { e.Click(); } }
public void SelectFavItem() { List <IWebElement> listElements = SiteDriver.FindElements(_demoPage.fav, How.CssSelector); foreach (IWebElement e in listElements) {/* * if (e.GetAttribute("value").Substring(5, 1) == "1") * {*/ e.Click(); } // } }
public int SelectMutipleFavFood() { int count = 0; ClickFavFood(); foreach (IWebElement e in SiteDriver.FindElements(_demoPage.favFood, How.CssSelector)) { count += e.Selected ? 1 : 0; } Console.WriteLine("count:" + count); return(count); }
public int SelectMultipleGender() { List <IWebElement> listElements = SiteDriver.FindElements(_demoPage.gender, How.CssSelector); int count = 0; foreach (IWebElement e in listElements) { e.Click(); } foreach (IWebElement e in listElements) { count += e.Selected ? 1 : 0; } return(count); }
public void SelectGender(int gender = 1) { List <IWebElement> listElements = SiteDriver.FindElements(_demoPage.gender, How.CssSelector); listElements[gender].Click(); }
public int FindCountOfElements(string cssLocator) { return(SiteDriver.FindElements(cssLocator, How.CssSelector).Count); }