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");
        }
Esempio n. 2
0
        [Test]/*add proper wait*/
        public void ClickSimpleFormDemoPageTest()
        {
            PropertiesCollection.driver.Navigate().GoToUrl("https://www.seleniumeasy.com/test/");
            HomePageObject           homePage           = new HomePageObject();
            SingleFormDemoPageObject singleFormDemoPage = new SingleFormDemoPageObject();

            Thread.Sleep(1000);
            singleFormDemoPage = homePage.ClickSimpleFormDemoPage();
            Thread.Sleep(1000);
            singleFormDemoPage.txtMessageField.SendKeys("HelloWorld");
            Thread.Sleep(1000);
            singleFormDemoPage.btnShowMessage.Clicks();
            Thread.Sleep(1000);
            Assert.AreEqual(SeleniumGetMethods.GetText(singleFormDemoPage.txtMessageField), "HelloWorld");
        }
Esempio n. 3
0
        public void RegistrationFormScenarioTest()
        {
            PropertiesCollection.driver.Navigate().GoToUrl("http://testing.todorvachev.com");

            HomePageObject             homePage             = new HomePageObject();
            TestScenariosPageObject    testScenariosPage    = new TestScenariosPageObject();
            RegistrationFormPageObject registrationFormPage = new RegistrationFormPageObject();

            testScenariosPage    = homePage.ClickTestScenariosPage();
            registrationFormPage = testScenariosPage.ClickRegistrationFormPage();
            registrationFormPage.txtUserID.SendKeys("IDeeeee");
            registrationFormPage.txtPassword.SendKeys("password");
            registrationFormPage.txtName.SendKeys("Mynamee");

            Assert.AreEqual(SeleniumGetMethods.GetText(registrationFormPage.txtUserID), "IDeeeee");
            Assert.AreEqual(SeleniumGetMethods.GetText(registrationFormPage.txtPassword), "password");
            Assert.AreEqual(SeleniumGetMethods.GetText(registrationFormPage.txtName), "Mynamee");
        }
Esempio n. 4
0
        public void LoginFormScenarioTest()
        {
            PropertiesCollection.driver.Navigate().GoToUrl("http://testing.todorvachev.com");

            HomePageObject          homePage          = new HomePageObject();
            TestScenariosPageObject testScenariosPage = new TestScenariosPageObject();
            LoginFormPageObject     loginFormPage     = new LoginFormPageObject();

            testScenariosPage = homePage.ClickTestScenariosPage();
            loginFormPage     = testScenariosPage.ClickLoginFormPage();
            loginFormPage.txtUsername.SendKeys("MEE");
            loginFormPage.txtPassword.SendKeys("password");
            loginFormPage.txtRepeatPassword.SendKeys("password1");

            Assert.AreEqual(SeleniumGetMethods.GetText(loginFormPage.txtUsername), "MEE");
            Assert.AreEqual(SeleniumGetMethods.GetText(loginFormPage.txtPassword), "password");
            Assert.AreEqual(SeleniumGetMethods.GetText(loginFormPage.txtRepeatPassword), "password1");
        }