示例#1
0
        public void AccessSiteStart()
        {
            driver.Navigate().GoToUrl("https://www.amazon.com");
            driver.Manage().Window.Maximize();
            System.Threading.Thread.Sleep(2000);
            String currentURL = driver.Url;

            verfying = new Verfying();
            if (verfying.HttpRequestStatusCode(currentURL) == true)
            {
                Console.WriteLine("Page uploaded.");
                System.Threading.Thread.Sleep(2000);
                LoginTest();
            }
            else
            {
                Console.WriteLine("Page not displayed.");
            }
        }
示例#2
0
        public void DisplayPage()
        {
            String previousURL = driver.Url;

            driver.FindElement(By.CssSelector("ul.a-pagination")).FindElement(By.LinkText("2")).Click();
            System.Threading.Thread.Sleep(2000);
            String currentURL = driver.Url;

            verfying = new Verfying();

            //page control
            if (previousURL != currentURL && verfying.HttpRequestStatusCode(currentURL) == true)
            {
                Console.WriteLine("Page 2 is displayed.");
            }
            else
            {
                Console.WriteLine("Page 2 is not displayed.");
            }
            AddToList();
        }