Example #1
0
        static void Main(string[] args)
        {
            try
            {
                IWebDriver driver = new ChromeDriver();
                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://av.by");

                MainPage mainPage = new MainPage(driver);
                mainPage.SelectBrand("Jaguar");
                mainPage.NavigateTo();

                ResultPage resultPage = new ResultPage(driver);
                resultPage.CalculateNumberOfEachModels();
                resultPage.SortListCars();
                resultPage.PrintListCars();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Example #2
0
        public void CalculateNumberOfEachModels()
        {
            MainPage mainPage = new MainPage(driver);
            string   brand    = "Acura";
            string   model    = "RL";

            mainPage.SelectBrand(brand);
            IWebElement selectModel = driver.FindElement(By.XPath("//select[@name = 'model_id[]']"));

            selectModel.SendKeys(model);
            var expextedList = driver.FindElements(By.XPath(Locator.elementsLocator));

            ResultPage resultPage = new ResultPage(driver);

            resultPage.CalculateNumberOfEachModels();
            foreach (Car c in resultPage.cars)
            {
                if (c.Model == model)
                {
                    Assert.AreEqual(expextedList.Count, c.CountCars);
                }
            }
        }