public void PopulatePageAndSubmit()
 {
     FirstName.SendKeys("Miller");
     LastName.SendKeys("John");
     UserEmail.SendKeys("*****@*****.**");
     Gender.Click();
     MobileNumber.SendKeys("0751123456");
     DateOfBirth.Click();
     Month.Click();
     Year.Click();
     Day.Click();
     Subjects.SendKeys("Test subjects");
     Thread.Sleep(2000);
     Hobbies.Click();
     ((IJavaScriptExecutor)_driver).ExecuteScript("arguments[0].scrollIntoView(true);", Picture);
     //Thread.Sleep(5000);
     //Picture.Click();
     CurrentAddress.SendKeys("Str. 13 Dec");
     Thread.Sleep(2000);
     StateDropDown.Click();
     StateOption.Click();
     CityDropDown.Click();
     CityOption.Click();
     Submit.Click();
 }
Ejemplo n.º 2
0
        public void EnterUserDetail()
        {
            SignInBtn.Click();
            EmailAddress.SendKeys("*****@*****.**");
            BasePage.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            CreateAcccontBtn.Click();

            // AC 4.1 create user account
            Gender.Click();
            FirstName.SendKeys("Nadeem");
            LastName.SendKeys("Digital");
            Password.SendKeys("123qwe");

            SelectElement DropDay = new SelectElement(Day);

            DropDay.SelectByValue("10");
            SelectElement DropMonth = new SelectElement(Month);

            DropMonth.SelectByValue("9");
            SelectElement DropYear = new SelectElement(Year);

            DropYear.SelectByValue("2020");

            CheckedSpecialOffer.Click();
            AddressFirstName.SendKeys("Nadeem");
            AddressLastName.SendKeys("Digital");
            Company.SendKeys("Test Digital Company");
            Address1.SendKeys("Leeds Town");
            Address2.SendKeys("LS1");
            City.SendKeys("Leeds");

            SelectElement DropDown = new SelectElement(State);

            DropDown.SelectByText("Florida");

            PostCode.SendKeys("00012");
            AdditionalInfo.SendKeys("This is first programme of testig");
            MobileNo.SendKeys("123456789");
            AddressFutureRef.SendKeys("NB_Test");
            ClickRegisterUser.Click();

            //AC 4.4 verify account namme
            Assert.AreEqual("Nadeem Digital", VerifyUser.Text);
            Console.WriteLine(VerifyUser.Text + " Displayed");


            Bpage.Imp_wait();
            //AC 4.3 verify user taken to MY ACCOUNT page
            Assert.IsTrue(Pageheading.Displayed);
            Console.WriteLine(Pageheading.Text + " Displayed");

            SignOut.Click();
        }
Ejemplo n.º 3
0
        public void FillUserCredetnials(RegistrationFormModel user)
        {
            FirstName.SendKeys(user.FirstName);
            LastName.SendKeys(user.LastName);
            Email.SendKeys(user.Email);
            Gender.Click();
            Phone.SendKeys(user.Phone);
            Driver.ScrollTo(HobbiesRadioButton);
            HobbiesRadioButton.Click();
            Address.SendKeys(user.Address);

            Submit.Click();
        }
Ejemplo n.º 4
0
        public void EnterInvalidDetail()
        {
            SignInBtn.Click();

            EmailAddress.SendKeys("*****@*****.**");
            BasePage.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            CreateAcccontBtn.Click();
            Gender.Click();

            // first name and last name not entered to get the error
            FirstName.SendKeys("");
            LastName.SendKeys("");
            Password.SendKeys("123qwe");

            SelectElement DropDay = new SelectElement(Day);

            DropDay.SelectByValue("10");
            SelectElement DropMonth = new SelectElement(Month);

            DropMonth.SelectByValue("9");
            SelectElement DropYear = new SelectElement(Year);

            DropYear.SelectByValue("2020");

            CheckedSpecialOffer.Click();
            AddressFirstName.SendKeys("Nadeem");
            AddressLastName.SendKeys("Digital");
            Company.SendKeys("Test Digital Company");
            Address1.SendKeys("Leeds Town");
            Address2.SendKeys("LS1");
            City.SendKeys("Leeds");

            SelectElement DropDown = new SelectElement(State);

            DropDown.SelectByText("Florida");

            PostCode.SendKeys("00012");
            AdditionalInfo.SendKeys("This is first programme of testig");
            MobileNo.SendKeys("123456789");
            AddressFutureRef.SendKeys("NB_Test");
            ClickRegisterUser.Click();

            //AC 4.2 verify the error message
            Assert.IsTrue(CreatAnAccoutError.Displayed);
            Console.WriteLine(CreatAnAccoutError.Text + " Displayed");
        }
Ejemplo n.º 5
0
        public void VerifyAutomationPracticeform()
        {
            //Applying Inplicit wait- wait for all the elements for the specified time if not immediately present
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));


            //Applying Explicit wait

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

            wait.Until(ExpectedConditions.ElementExists(By.Name("lastname")));  // waits for the specified time , until the expected conditions are met.



            firstName = driver.FindElement(By.Name("firstname"));
            firstName.SendKeys("Manisa");

            LastName = driver.FindElement(By.Name("lastname"));
            LastName.SendKeys("Maji");

            // Handling Radiobuttons

            Gender = driver.FindElement(By.Id("sex-1"));
            Gender.Click(); //select gender female

            YrsofExp = driver.FindElement(By.Id("exp-3"));
            YrsofExp.Click(); // select years of experience as 3

            // Handling Checkboxes

            ProfessionM = driver.FindElement(By.Id("profession-0"));
            ProfessionA = driver.FindElement(By.Id("profession-1"));

            //Single select drodown
            new SelectElement(driver.FindElement(By.Id("continents"))).SelectByText("Europe");

            //multiple select dropdown

            new SelectElement(driver.FindElement(By.Id("selenium_commands"))).SelectByText("Browser Commands");
            new SelectElement(driver.FindElement(By.Id("selenium_commands"))).SelectByText("Switch Commands");
            Thread.Sleep(5000);
        }
Ejemplo n.º 6
0
        public void FillPersonalDetails()
        {
            SelectElement oSelect = new SelectElement(driver.FindElement(By.Id("TitleCombo")));

            oSelect.SelectByText(ExcelOperation.GetData[1]);
            GivenName.Clear();

            string GivenNameString = GenericHelper.RandomString(5);

            ExcelOperation.AddData("TestData2", GivenNameString, "TC1_CreateAnEmployee");
            GivenName.SendKeys(GivenNameString);
            OtherName.Clear();

            OtherName.SendKeys(ExcelOperation.GetData[3]);
            Surname.Clear();
            Surname.SendKeys(ExcelOperation.GetData[4]);
            PreferenceName.Clear();

            PreferenceName.SendKeys(ExcelOperation.GetData[5]);
            DateOfBirth.Clear();
            DateOfBirth.SendKeys(ExcelOperation.GetData[6]);
            Gender.Click();

            MobNumber.Clear();
            // MobNumber.SendKeys(ExcelOperation.GetData[7]);
            MobNumber.SendKeys("9999 999999");
            EmailID.Clear();
            EmailID.SendKeys(ExcelOperation.GetData[8]);

            PerferedMethodToContact.Click();
            GenericHelper.AllScreenShot(driver);
            var ele = driver.FindElement(By.Id("CommandButtons_cmdNextEnabled"));
            IJavaScriptExecutor executor = (IJavaScriptExecutor)driver;

            executor.ExecuteScript("var ele=arguments[0];setTimeout(function(){ele.click();},100)", ele);
        }