예제 #1
0
        public static void OrderByPriceAscendant()
        {
            SeleniumSetMethods.PerformMovement(Properties.driver, SeleniumGetMethods.GetElement(Properties.driver, "w7", "Id"));
            SeleniumSetMethods.Click(Properties.driver, "//*[@class='srp-sort__menu']/li[4]", "xpath");

            //printing first 5 results in console
            listproduct = SeleniumGetMethods.GetProductsFromList(Properties.driver, 5);

            foreach (Product element in listproduct)
            {
                PrintResults(element.GetTitle());
                PrintResults(element.GetPrice());
            }
        }
예제 #2
0
 public static void AssertElementDisplayed(IWebElement element)
 {
     try
     {
         if (SeleniumGetMethods.GetElement(element))
         {
             Assert.That(element.Displayed);
             Reporter.AddTestInfo(ProjectUtilities.Utilities.GetCurrentMethod() + " => " + "Elemento encontrado: " + element.GetElementAttribute());
         }
     }
     catch (Exception ex)
     {
         Assert.Fail("{0} Element no displayed", ex);
     }
 }