Exemple #1
0
        public void ClickFavFood()
        {
            List <IWebElement> listElements = SiteDriver.FindElements(_demoPage.favFood, How.CssSelector);


            foreach (IWebElement e in listElements)
            {
                e.Click();
            }
        }
Exemple #2
0
        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();
            }
            // }
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        public void SelectGender(int gender = 1)
        {
            List <IWebElement> listElements = SiteDriver.FindElements(_demoPage.gender, How.CssSelector);

            listElements[gender].Click();
        }
Exemple #6
0
 public int FindCountOfElements(string cssLocator)
 {
     return(SiteDriver.FindElements(cssLocator, How.CssSelector).Count);
 }