예제 #1
0
        public void LoginAndFillCheckSite()
        {
            PropertiesCollection.driver.Navigate().GoToUrl("http://executeautomation.com/demosite/Login.html");

            LoginPageObject pageLogin = new LoginPageObject();

            EAPageObject pageEA = pageLogin.Login("execute", "automation");

            WebDriverWait wait = new WebDriverWait(PropertiesCollection.driver, TimeSpan.FromSeconds(15));

            IWebElement input = wait.Until <IWebElement>(d => d.FindElement(By.Name("TitleId")));

            pageEA.FillFullForm("Mr.", "MD", "Maats", "Dijk");

            IWebElement element = PropertiesCollection.driver.FindElement(By.Name("TitleId"));

            Assert.AreEqual(SeleniumGetMethods.GetTextFromDDL(element), "Mr.", "Wrong prefix chosen");

            element = PropertiesCollection.driver.FindElement(By.Name("Initial"));

            Assert.AreEqual(SeleniumGetMethods.GetText(element), "MD");

            element = PropertiesCollection.driver.FindElement(By.Name("FirstName"));

            Assert.AreEqual(SeleniumGetMethods.GetText(element), "Maats");

            element = PropertiesCollection.driver.FindElement(By.Name("MiddleName"));

            Assert.AreEqual(SeleniumGetMethods.GetText(element), "Dijk");
        }
예제 #2
0
        public void AlertJSTestDismiss()
        {
            PropertiesCollection.driver.Navigate().GoToUrl("http://executeautomation.com/demosite/Login.html");

            LoginPageObject pageLogin = new LoginPageObject();

            EAPageObject pageEA = pageLogin.Login("execute", "automation");

            pageEA.btnGenerateJSALert.Click();

            IAlert simpleAlert = PropertiesCollection.driver.SwitchTo().Alert();

            Thread.Sleep(3000);
            String alertText = simpleAlert.Text;

            Console.WriteLine("Alert text is " + alertText);

            Thread.Sleep(3000);
            simpleAlert.Dismiss();

            Thread.Sleep(3000);
            alertText = simpleAlert.Text;
            Console.WriteLine("Alert text is " + alertText);

            simpleAlert.Accept();
        }
예제 #3
0
        public void LoginAndFillAutomationSite()
        {
            PropertiesCollection.driver.Navigate().GoToUrl("http://executeautomation.com/demosite/Login.html");

            LoginPageObject pageLogin = new LoginPageObject();

            EAPageObject pageEA = pageLogin.Login("execute", "automation");

            pageEA.FillFullForm("Mr.", "MD", "Maats", "Dijk");
        }
예제 #4
0
        public void PageObjectAutomationSite()
        {
            PropertiesCollection.driver.Navigate().GoToUrl("http://executeautomation.com/demosite/index.html");

            EAPageObject page = new EAPageObject();

            page.txtInitial.SendKeys("executeautomation");

            page.btnSave.Click();
        }
예제 #5
0
        public void ClickToAutomationSite()
        {
            PropertiesCollection.driver.Navigate().GoToUrl("http://executeautomation.com/demosite/Login.html");

            LoginPageObject pageLogin = new LoginPageObject();

            EAPageObject pageEA = pageLogin.Login("execute", "automation");

            pageEA.SelectSeleniumWebDriverFromMenu();
        }
예제 #6
0
        public void DragAndDropAction()
        {
            PropertiesCollection.driver.Navigate().GoToUrl("http://executeautomation.com/demosite/Login.html");

            LoginPageObject pageLogin = new LoginPageObject();

            EAPageObject pageEA = pageLogin.Login("execute", "automation");

            DragDropPageObject pageDragDrop = pageEA.DragDropPageClick();

            pageDragDrop.DragOneElem(pageDragDrop.itemDrag2, pageDragDrop.itemDrag5);

            pageDragDrop.DragOneElem(pageDragDrop.itemDrag1, pageDragDrop.itemDrag5);
        }
예제 #7
0
        public void ClickHMTLPopup()
        {
            PropertiesCollection.driver.Navigate().GoToUrl("http://executeautomation.com/demosite/Login.html");

            LoginPageObject pageLogin = new LoginPageObject();

            EAPageObject pageEA = pageLogin.Login("execute", "automation");

            HTMLPopupPageObject pageHTMLPopup = pageEA.ClickHMTLPopup();

            //Change handler to second window
            PropertiesCollection.driver.SwitchTo().Window(PropertiesCollection.driver.WindowHandles[1]);

            //Fill form
            pageHTMLPopup.FillUserForm("Mr.", "MD", "Maats", "Dijk", "Doode");

            //Close the popup window
            PropertiesCollection.driver.Close();

            //Switch handler to main window
            PropertiesCollection.driver.SwitchTo().Window(PropertiesCollection.driver.WindowHandles[0]);
        }