Example #1
0
        public void Run()
        {
            var        webDriverPath = Path.Combine(Environment.CurrentDirectory, @"web-drivers\");
            IWebDriver driver        = new ChromeDriver(webDriverPath);

            driver.Manage().Window.Maximize();

            //Kill few mins
            BrowseTheWeb(driver);

            //go to sony direct
            driver.TryGoHere(SonyDirectUrl);

            //click sign in link
            var signInElem = driver.FindElements(By.CssSelector("a.js-topnav-desktop-signin-link"));

            signInElem.FirstOrDefault().Click();
            Thread.Sleep(TimeSpan.FromSeconds(5));

            if (!string.IsNullOrWhiteSpace(SonyUserName) && !string.IsNullOrWhiteSpace(SonyPassword))
            {
                AutoLoginToSony(driver, SonyUserName, SonyPassword);
                Thread.Sleep(TimeSpan.FromSeconds(10));
            }
            else
            {
                Console.WriteLine("Manually login and press any key to continue");
                Console.ReadLine();
            }

            driver.ChallengeDetection();
            driver.TryGoHere(PS5Url);

            TryAddToCart(driver, RetryEvery, BatchReties, BatchSleep);
        }