public void TestNameFieldEmpty()
        {
            var         chromeDriver = new BrowserUtility().Init(driver);
            IWebElement nameField    = chromeDriver.FindElement(By.CssSelector("#Name"));

            nameField.SendKeys("");
            IWebElement emailField = chromeDriver.FindElement(By.CssSelector("#Email"));

            emailField.SendKeys("*****@*****.**");
            IWebElement userNameField = chromeDriver.FindElement(By.CssSelector("#Username"));

            userNameField.SendKeys("Random");
            IWebElement passwordField = chromeDriver.FindElement(By.CssSelector("#Password"));

            passwordField.SendKeys("Random");
            IWebElement telephoneField = chromeDriver.FindElement(By.CssSelector("#Telephone"));

            telephoneField.SendKeys("1111111");
            IWebElement element = chromeDriver.FindElement(By.CssSelector(".ui.fluid.large.primary.submit.button"));

            element.Click();
            var errorMessage = chromeDriver.FindElement(By.CssSelector(".list > li:nth-child(1)")).Text;


            Assert.AreEqual("The Name field is required.", errorMessage);

            chromeDriver.Close();
        }
Beispiel #2
0
        public void Method3()
        {
            var Driver = new BrowserUtility().Init(driver);

            driver.FindElement(By.Id("comment")).SendKeys("good \n morning");
            Driver.Close();
        }
        public void TestMethod2()
        {
            var driver = new BrowserUtility().Init(Driver);

            IWebElement email = driver.FindElement(By.XPath("//input[@id='email']"));

            email.SendKeys("Password");
            IWebElement password = driver.FindElement(By.XPath("//input[@id='pass']"));

            password.SendKeys("Password");
            IWebElement   year_drp      = driver.FindElement(By.XPath("//select[@id='year']"));
            IWebElement   month_drp     = driver.FindElement(By.XPath("//select[@id='month']"));
            IWebElement   day_drp       = driver.FindElement(By.XPath("//select[@id='day']"));
            SelectElement element_day   = new SelectElement(day_drp);
            SelectElement element_month = new SelectElement(month_drp);
            SelectElement element_year  = new SelectElement(year_drp);

            element_day.SelectByValue("22");
            Thread.Sleep(200);
            element_month.SelectByIndex(3);
            Thread.Sleep(200);
            element_year.SelectByText("2020");
            Thread.Sleep(2000);

            driver.Close();
        }
Beispiel #4
0
        public void TestMethod9()
        {
            var         Driver         = new BrowserUtility().Init(driver);
            IWebElement EmailTextField = driver.FindElement(By.XPath("//*[@id='email']"));

            EmailTextField.SendKeys("Selenium c#");
            Driver.Close();
        }
Beispiel #5
0
        public void ChromeBrowser08()
        {
            var         Driver         = new BrowserUtility().Init(driver);
            IWebElement emailTextField = Driver.FindElement(By.XPath(".//*[@id='email']"));

            emailTextField.SendKeys("*****@*****.**");
            Driver.Close();
        }
Beispiel #6
0
        public void TestMethod7()
        {
            var         Driver   = new BrowserUtility().Init(driver);
            IWebElement userName = Driver.FindElement(By.XPath(".//*[@name='fullname']"));

            userName.SendKeys("da da da");
            Driver.Close(); // בהורשה כזאת חייב לסגור את הפונקציה אחרת זה רץ ברקע
        }
Beispiel #7
0
        public void TestLogin5()
        {
            var         Driver       = new BrowserUtility().Init(driver);
            IWebElement usernamePlem = Driver.FindElement(By.Id("user"));

            usernamePlem.SendKeys("Mateusz");
            Driver.Close();
        }
Beispiel #8
0
        public void TestPassword4()
        {
            var         Driver = new BrowserUtility().Init(driver);
            IWebElement pwPlem = Driver.FindElement(By.Id("password"));

            pwPlem.SendKeys("Mateusz");
            Driver.Close();
        }
        public void TestMethod8()
        {
            var         Driver         = new BrowserUtility().Init(driver);
            IWebElement emailTextField = Driver.FindElement(By.XPath(".//*[@id='gh-ac']"));

            emailTextField.SendKeys("Selenium C#");
            Driver.Close();
        }
        public void TestMethodParallel7()
        {
            var         Driver         = new BrowserUtility().initFirefox(driver);
            IWebElement emailTextField = Driver.FindElement(By.XPath("//input[@id='email']"));

            emailTextField.SendKeys("*****@*****.**");
            Thread.Sleep(2000);
            Driver.Close();
        }
Beispiel #11
0
        public void TestMethod3()
        {
            var Driver = new BrowserUtility().init(driver);

            Driver.Url = "https://www.digitalife.com.mx/";
            HomePage home = new HomePage(Driver);

            home.SearchBox.SendKeys("Ryzen 5");
            Thread.Sleep(3000);
            Driver.Close();
        }
Beispiel #12
0
        public void Test7()
        {
            var Driver = new BrowserUtility().Init(driver);


            IWebElement emailFeilds = Driver.FindElement(By.XPath(".//*[@id='email']"));

            emailFeilds.SendKeys("*****@*****.**");
            IWebElement password = driver.FindElement(By.XPath(".//*[@id='password']"));

            password.SendKeys("Ec1505451@");
            Driver.Close();
        }
Beispiel #13
0
        public void TestCheckboxes2()
        {
            var Driver = new BrowserUtility().InitF(driver);
            //se crea un WebElement donde se guarda el radio1 para luego darle click
            IWebElement checkbox1 = Driver.FindElement(By.XPath("//input[@id='checkBoxOption1']"));

            checkbox1.Click();
            IWebElement checkbox2 = Driver.FindElement(By.XPath("//input[@id='checkBoxOption2']"));

            checkbox2.Click();
            IWebElement checkbox3 = Driver.FindElement(By.XPath("//input[@id='checkBoxOption3']"));

            checkbox3.Click();
            Assert.IsTrue(checkbox1.Selected);
            Assert.IsTrue(checkbox2.Selected);
            Assert.IsTrue(checkbox3.Selected);
            Driver.Close();
        }
 public void Close()
 {
     extent.Flush();
     BrowserUtility.Close();
 }