Beispiel #1
0
        public Flights DoSearch(Boolean check2Scales = true, string dest = "Barcelona, España (BCN-Todos los aeropuertos)")
        {
            FlyButton.Click();
            OrigenTxtBox.SendKeys("Chihuahua, Chihuahua, México (CUU-A. Internacional General Roberto Fierro Villalobos)");
            DestTxtBox.SendKeys(dest);
            DateDep.Click(); //some times this node isn't visible it is required to clean and build to run propertly I didn't figure it out why
            DepDate.Click();
            DateRet.Click();
            RetDate.Click();
            SubmitBton.Click();
            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromMilliseconds(30000));

            wait.Until(ExpectedConditions.ElementIsVisible(By.Id("stopFilter_stops-2")));
            if (check2Scales)
            {
                driver.FindElement(By.Id("stopFilter_stops-2")).Click();
            }

            return(new Flights());
        }
Beispiel #2
0
        public Hotels DoSearchByHotelFly()
        {
            FlyButton.Click();
            OrigenTxtBox.SendKeys("Chihuahua, Chihuahua, México (CUU-A. Internacional General Roberto Fierro Villalobos)");
            DestTxtBox.SendKeys("Barcelona, España (BCN-Todos los aeropuertos)");

            DateDep.Click();
            DepDate.Click();
            DateRet.Click();
            RetDate.Click();
            FlyHotelButton.Click();
            SubmitBton.Click();
            try
            {
                WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromMilliseconds(30000));
                wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@class='imgLoading']")));
            }catch (TimeoutException tex)
            {
                throw new Exception();
            }

            return(new Hotels());
        }