예제 #1
0
        public void TestSetItemsSelected_WhenMultipleSelect()
        {
            multiSelect.Checked = true;
            Submit.Click();

            AssertEquals(ListSelectionMode.Multiple, List.SelectionMode);
            AssertEquals(1, List.SelectedIndex);

            List.Items[0].Selected = true;
            List.Items[2].Selected = true;
            Submit.Click();

            AssertEquals("item #0 selected", true, List.Items[0].Selected);
            AssertEquals("item #1 selected", true, List.Items[1].Selected);
            AssertEquals("item #2 selected", true, List.Items[2].Selected);

            List.Items[1].Selected = false;
            Submit.Click();

            AssertEquals("item #0 selected", true, List.Items[0].Selected);
            AssertEquals("item #1 selected", false, List.Items[1].Selected);
            AssertEquals("item #2 selected", true, List.Items[2].Selected);

            List.Items[1].Selected = true;
            Submit.Click();
        }
 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();
 }
예제 #3
0
        public void AddSentenceToSearch(string sequenceToAdd)
        {
            string existingText = _wait.Until(ExpectedConditions.ElementToBeClickable(SearchInput)).Text;

            _driver.SendKeysAction(SearchInput, $"{existingText} {sequenceToAdd}");
            Submit.Click();
        }
예제 #4
0
        public void TestRegPagewithBlankFieldsonCompulsaryDataFields()
        {
            string        firstName = "";
            string        lastName = "";
            string        department = "Engineering";
            string        userName = "";
            string        password = "";
            string        eMail = "";
            string        contact = "9867564790";
            IWebElement   FName, LName, UName, Pwd, confirmPwd, Email, Phone, Submit;
            SelectElement Department;

            regPage.elements(Browser, out FName, out LName, out UName, out Pwd, out confirmPwd, out Email, out Phone, out Department, out Submit);
            FName.SendKeys(firstName);
            LName.SendKeys(lastName);
            Department.SelectByText(department);
            UName.SendKeys(userName);
            Pwd.SendKeys(password);
            confirmPwd.SendKeys(password);
            Phone.SendKeys(contact);
            Email.SendKeys(eMail);
            if (Submit.Displayed && Submit.Enabled)
            {
                Submit.Click();
            }
            Assert.IsTrue((isInvalidDataIcon(FName)), "Invalid data icon is not displayed on entering the incorrect data on First Name" + FName.Text);
            Assert.IsTrue((isInvalidDataIcon(LName)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + LName.Text);
            Assert.IsTrue((isInvalidDataIcon(UName)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + UName.Text);
            Assert.IsTrue((isInvalidDataIcon(Pwd)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + Pwd.Text);
            Assert.IsTrue((isInvalidDataIcon(confirmPwd)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + confirmPwd.Text);
            Assert.IsTrue((isInvalidDataIcon(Email)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + Email.Text);
            Assert.IsFalse((Submit.Enabled), "The form has blank data in required fields but Submit is enabled");
        }
예제 #5
0
 public void SignInAndLogin(UserRegistration user)
 {
     Navigate(Url);
     SighInButton.Click();
     ElementExtension.Type(Email, user.Email);
     Submit.Click();
 }
예제 #6
0
        public void TestRegPageWithValidValues()
        {
            string        firstName = "John";
            string        lastName = "Kerry";
            string        department = "Engineering";
            string        userName = "******";
            string        password = "******";
            string        eMail = "*****@*****.**";
            string        contact = "9867564789";
            IWebElement   FName, LName, UName, Pwd, confirmPwd, Email, Phone, Submit;
            SelectElement Department;

            regPage.elements(Browser, out FName, out LName, out UName, out Pwd, out confirmPwd, out Email, out Phone, out Department, out Submit);
            FName.SendKeys(firstName);
            //var isValidIcon = FName.FindElement(By.ClassName("glyphicon-ok"));
            Assert.IsTrue((isValidDataIcon(FName)), "valid data icon is not displayed on entering the correct data on First Name" + FName.Text);
            LName.SendKeys(lastName);
            Assert.IsTrue((isValidDataIcon(LName)), "valid data icon is not displayed on entering the correct data on Last Name" + LName.Text);
            Department.SelectByText(department);
            UName.SendKeys(userName);
            Assert.IsTrue((isValidDataIcon(UName)), "valid data icon is not displayed on entering the correct data on Last Name" + UName.Text);
            Pwd.SendKeys(password);
            Assert.IsTrue((isValidDataIcon(Pwd)), "valid data icon is not displayed on entering the correct data on Last Name" + Pwd.Text);
            confirmPwd.SendKeys(password);
            Assert.IsTrue((isValidDataIcon(confirmPwd)), "valid data icon is not displayed on entering the correct data on Last Name" + confirmPwd.Text);
            Phone.SendKeys(contact);
            Assert.IsTrue((isValidDataIcon(Phone)), "valid data icon is not displayed on entering the correct data on Last Name" + Phone.Text);
            Email.SendKeys(eMail);
            Assert.IsTrue((isValidDataIcon(Email)), "valid data icon is not displayed on entering the correct data on Last Name" + Email.Text);
            Submit.Click();
            var success = Browser.FindElement(By.Id("contact_form"));

            Assert.True((success.Text == "Thanks"), "Registration was unsuccessful");
        }
        public void FillRegistrationForm(RegistrationUser user)
        {
            SureType(this.FirstName, user.FirstName);
            SureType(this.LastName, user.LastName);

            FillManyOptionElements(this.MaritalStatus, user.MatrialStatus);
            FillManyOptionElements(this.Hobbies, user.Hobbies);

            this.Country.SelectByText(user.Country);

            this.MonthBirth.SelectByValue(user.Month);
            this.DayBirth.SelectByValue(user.Day);
            this.YearBirth.SelectByValue(user.Year);

            SureType(this.Phone, user.Phone);
            SureType(this.Username, user.UserName);
            SureType(Email, user.Email);

            UploadPictureButton.Click();
            Driver.SwitchTo().ActiveElement().SendKeys(user.PicturePath);


            SureType(this.AboutYourself, user.AboutYourself);
            SureType(this.Password, user.Password);
            SureType(this.ConfirmPassword, user.ConfirmPassword);
            Submit.Click();
        }
        public bool InteressentMandatoryFill()
        {
            try
            {
                Language.SendKeys(LanguagesEnglishVersion.English);
                Title.EnterText(Titles.Ms);
                FirstName.EnterText(string.Format("{0}", Name));
                LastName.EnterText(string.Format("{0}", Name));
                Email.EnterText(Emails.HrmTest);
                Telephone.EnterText("084-2565584");

                Nationality.Click();
                PropertiesCollection.Sleep500();
                page1NationalityGerman.Click();

                Submit.Click();

                while (!ReadyThankyou())
                {
                    ;
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
 public void PopulateAndSubmit()
 {
     UserName.SendKeys("Miller John");
     UserEmail.SendKeys("*****@*****.**");
     CurrentAddress.SendKeys("Brasov, Str. 13 Dec");
     PermanentAddress.SendKeys("Brasov, Str. 13 Dec");
     Submit.Click();
 }
        public void FillLoginForm()
        {
            Fixture fixture           = new Fixture();
            string  randomEmailPrefix = fixture.Create <String>().Substring(0, 5);

            Email.SendKeys(randomEmailPrefix + "@gmail.com");
            Submit.Click();
        }
예제 #11
0
        public void TestSelectionMode()
        {
            AssertEquals("Selection mode", ListSelectionMode.Single, List.SelectionMode);

            multiSelect.Checked = true;
            Submit.Click();
            AssertEquals("Selection mode", ListSelectionMode.Multiple, List.SelectionMode);
        }
예제 #12
0
        public void TestSelectionPreserved_WhenMultiple()
        {
            TestSetItemsSelected_WhenMultipleSelect();
            Submit.Click();

            AssertEquals("item #0 selected", true, List.Items[0].Selected);
            AssertEquals("item #1 selected", true, List.Items[1].Selected);
            AssertEquals("item #2 selected", true, List.Items[2].Selected);
        }
예제 #13
0
        public void Register()
        {
            Name.SendKeys("Test User");
            DoB.SendKeys("11/11/11");
            Address.SendKeys("125 King Street, Auckland");
            Contact.SendKeys("+64100200300");
            Submit.Click();
            commonLib cl = new commonLib();

            cl.popup(this.driver);
        }
예제 #14
0
        public void TestGroupedCheck()
        {
            AssertEquals(true, groupedOne.Checked);
            AssertEquals(false, groupedTwo.Checked);

            groupedTwo.Checked = true;
            Submit.Click();

            AssertEquals(false, groupedOne.Checked);
            AssertEquals(true, groupedTwo.Checked);
        }
        public void FillForm(PracticeFormModel user)
        {
            FirstName.SendKeys(user.FirstName);
            LastName.SendKeys(user.LastName);
            Email.SendKeys(user.Email);
            Gender(user.Gender).Click();
            PhoneNumber.SendKeys(user.PhoneNumber);
            SportCheckBox.Click();

            ScrollTo(Submit);
            Submit.Click();
        }
예제 #16
0
        /// <summary>
        /// Search and sign off trials.
        /// </summary>
        /// <param name="contextTrialTitle">The context trial title.</param>
        /// <returns>System.String.</returns>
        public string SearchAndSignOffTrials(string contextTrialTitle)
        {
            SignOffTrialSummarySearch.SendKeys(contextTrialTitle);
            SignOffTrialSummaryResult_Title.Text.Should().BeEquivalentTo(contextTrialTitle);
            var reportPeriod = SignOffTrialSummaryResult_ReportPeriod.Text;

            NewFTE.Click();
            FTEInput.SendKeys("2");
            SignOffCheckBox.Click();
            Submit.Click();
            return(reportPeriod);
        }
예제 #17
0
 public virtual IBaseScreenView SubmitForm()
 {
     try
     {
         Submit.Click();
         DriverCommands.WaitAndMeasurePageLoadTime();
     }
     catch (Exception e)
     {
         //
     }
     return(ReturnSubmitPage());
 }
예제 #18
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();
        }
예제 #19
0
 public void edit_account(string acc_no)
 {
     try
     {
         EditAccountLink.Click();
         AccountNo.SendKeys(acc_no);
         Submit.Click();
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         TakeScreenshot.takeScreenshotAs(driver, "edit_account");
     }
 }
예제 #20
0
        public void TestSelectedIndex_WhenMultiple()
        {
            TestSetItemsSelected_WhenMultipleSelect();

            AssertEquals("item #0 selected", true, List.Items[0].Selected);
            AssertEquals("item #1 selected", true, List.Items[1].Selected);
            AssertEquals("item #2 selected", true, List.Items[2].Selected);

            List.SelectedIndex = 0;
            Submit.Click();

            AssertEquals("item #0 selected", true, List.Items[0].Selected);
            AssertEquals("item #1 selected", false, List.Items[1].Selected);
            AssertEquals("item #2 selected", false, List.Items[2].Selected);
        }
예제 #21
0
        public void newAccount(string cust_id, string acc_type, string initial_ammount)
        {
            NewAccountLink.Click();

            CustomerId.SendKeys(cust_id);

            SelectElement option = new SelectElement(AccountType);

            option.SelectByText(acc_type);


            InitialDeposite.SendKeys(initial_ammount);

            Submit.Click();
        }
예제 #22
0
        private void Search(string category)
        {
            JobFamilySelect.SelectByValue(category);

            Submit.Click();

            wait.Until(d => BrowseJobsHeader.Displayed);

            // check for most likely element, which in this case is a no results message
            if (ResultsMessage.Displayed)
            {
                driver.Close();

                Assert.Inconclusive("No results were shown");
            }
        }
        /* driver.FindElement(By.CssSelector(".datepicker-days .next > .glyphicon")).Click();
         * {
         *   var element = driver.FindElement(By.CssSelector(".datepicker-days .next > .glyphicon"));
         *   Actions builder = new Actions(driver);
         * builder.DoubleClick(element).Perform();
         * } */



        public void RegistrationPage()
        {
            CommonUtils cookieIgnore = new CommonUtils(driver);

            cookieIgnore.RejectAll_Cookies();

            SignIn_Page.Click();


            Excel_Suite userEmail = new Excel_Suite(Env.EXCEL_TEST_URL);

            userEmail.getCellData("SPP_TestData", true);
            Email_Text.SendKeys(Env.Email_Id);
            Password_Text.SendKeys("Test@123");

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

            Thread.Sleep(800);
            Submit.Click();


            dropdown_NCS.Click();
            NCS_Tab.Click();

            RetrieveCHICK.Click();

            Excel_Suite     childDataExcel = new Excel_Suite(Env.EXCEL_TEST_CHILD_DATA);
            ChildAward_Data ChildData      = childDataExcel.GetChildDetails(Env.EXCEL_TEST_CHILD_DATA);


            Eyp_firstname.SendKeys(ChildData.ChildFirstName);
            Eyp_lastname.SendKeys(ChildData.ChildLastName);

            DateOfBirth.SendKeys(ChildData.DateOfBirth);
            Eyp_chic.SendKeys(ChildData.ChildIdentifierCode);

            NextButton.Click();

            StartDate.SendKeys("");

            EndDate.SendKeys("");

            NextButton.Click();

            Claimedhours.SendKeys("4");
        }
예제 #24
0
        public void Hotel_Room_Add()
        {
            LoginAsAdmin();

            AddHotel(out string name).
            Hotels.Rows[x => x.Name == name].Should.BeVisible();
            Go.To <RoomsPage>().
            Add().
            HotelName.Set(name).
            RoomType.Set("Double or Twin Rooms").
            RoomDescription.SetRandom().
            Price.SetRandom(out int price).
            Submit.Click();
            Go.To <RoomsPage>().
            Rooms.Rows.FirstOrDefault().Price.Should.Equal(price.ToString()).
            Rooms.Rows.FirstOrDefault().Hotel.Should.Equal(name);
        }
        internal void FormSubmitwithDDT()
        {
            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));

            try
            {
                wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(FileUpload));
                string wanted_path = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..\\..\\..\\GlobalSQA\\"));
                Helpers.ExcelLib.populateInCollection(wanted_path + "TestData.xlsx", "Data");
                FileUpload.SendKeys(wanted_path + "NUNNA.jpg");
                Name.Click();
                Name.SendKeys(Helpers.ExcelLib.ReadData(2, "Name"));
                Email.SendKeys(Helpers.ExcelLib.ReadData(2, "Email"));
                Website.SendKeys(Helpers.ExcelLib.ReadData(2, "WebSite"));
                SelectElement expe = new SelectElement(Experience);
                expe.SelectByValue(Helpers.ExcelLib.ReadData(2, "Experiene"));
                Functional.Click();
                Automation.Click();
                Manual.Click();
                Education.Click();
                AlertButton.Click();
                IAlert alert = driver.SwitchTo().Alert();
                alert.Accept();
                IAlert alert1 = driver.SwitchTo().Alert();
                alert1.Accept();
                Helpers.HelperClass.GetElementAndScrollTo(driver, By.XPath("//textarea[@class='textarea']"));
                Comment.Click();
                Comment.SendKeys(Helpers.ExcelLib.ReadData(2, "Comment"));
                string FilledForm = Helpers.HelperClass.SaveScreenshot(driver, "FilledForm");
                Test.Log(Status.Pass, "Before form Submitted", MediaEntityBuilder.CreateScreenCaptureFromPath(FilledForm).Build());
                Submit.Click();
                wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(ResponseMesage));
                Helpers.HelperClass.GetElementAndScrollTo(driver, By.XPath("//div[@class='twelve columns']//h3"));
                String responseMsg = ResponseMesage.Text;
                Assert.AreEqual(responseMsg, Helpers.ExcelLib.ReadData(2, "Assertion"));
                string ResponseMsgScreenShot = Helpers.HelperClass.SaveScreenshot(driver, "ResponseMsgScreenShot");
                Test.Log(Status.Pass, "After Response Generated", MediaEntityBuilder.CreateScreenCaptureFromPath(ResponseMsgScreenShot).Build());
            }
            catch (Exception e)
            {
                Test.Log(AventStack.ExtentReports.Status.Fail, "Test failed,please check the logs" + e);
            }
        }
        public void FillForm(PracticeFormModel user)
        {
            Gender(user.Gender).Click();
            FirstName.SendKeys(user.FirstName);
            LastName.SendKeys(user.LastName);
            Password.SendKeys(user.Password);
            Day.SendKeys(user.Day);
            Month.SelectByValue(user.Month);
            Year.SendKeys(user.Year);
            CompanyName.SendKeys(user.CompanyName);
            Address.SendKeys(user.Address);
            City.SendKeys(user.Address);
            State.SelectByValue(user.State);
            PostCode.SendKeys(user.PostCode);
            Phone.SendKeys(user.Phone);
            PhoneMobile.SendKeys(user.PhoneMobile);
            Alias.SendKeys(user.Alias);

            Submit.Click();
        }
예제 #27
0
        // FillForm with elements from PageModel class
        public void FillForm(Pattern UserData)
        {
            if (UserData.Gender >= 0 && UserData.Gender <= (int)ExtendedMethods.Gender.Male)
            {
                RadioButtons[UserData.Gender].Click();
            }

            ExtendedMethods.SendText_to_Element(Customer_FirstName, UserData.FirstName);
            ExtendedMethods.SendText_to_Element(Customer_LastName, UserData.LastName);
            ExtendedMethods.SendText_to_Element(Password, UserData.Password);
            DateDD.SelectByValue(UserData.B_Date);
            MonthDD.SelectByValue(UserData.B_Mounts);
            YearDD.SelectByValue(UserData.B_Year);
            ExtendedMethods.SendText_to_Element(FinalFirstName, UserData.Final_FirstName);
            ExtendedMethods.SendText_to_Element(FinalLastName, UserData.Final_LastName);
            ExtendedMethods.SendText_to_Element(Address, UserData.Address);
            if (UserData.Country == String.Empty)
            {
                Country.SelectByIndex(0);
            }
            else
            {
                Country.SelectByText(UserData.Country);
            }
            ExtendedMethods.SendText_to_Element(City, UserData.City);

            if (UserData.State == String.Empty)
            {
                State.SelectByIndex(0);
            }
            else
            {
                State.SelectByText(UserData.State);
            }

            ExtendedMethods.SendText_to_Element(PostCode, UserData.Zip);
            ExtendedMethods.SendText_to_Element(Phone, UserData.Phone);
            ExtendedMethods.SendText_to_Element(Alias, UserData.alias);
            Submit.Click();
        }
예제 #28
0
        public void test()
        {
            ClickMe.Click();
            string              text       = GetMethods.GetTextValue(GenerateText);
            SelectElement       selectList = new SelectElement(ddl);
            IList <IWebElement> options    = selectList.Options;

            for (int j = 2; j < options.Count; j++)
            {
                string optionText = options[j].Text.ToString();
                Console.WriteLine("{0} : {1}", text, optionText);
                if (text.Equals(optionText))
                {
                    SetMethods.SelectDropDown(ddl, optionText);
                    break;
                }
            }
            Submit.Click();
            Thread.Sleep(800);
            Assert.IsTrue(Completed.Text.Contains("Good job"), "Not Completed");
            ClosePopUp.Click();
        }
예제 #29
0
 public void FillForm(Models user)
 {
     Form[1].Click();
     FormBtn[1].Click();
     FirstName.SendKeys(user.FirstName);
     LastName.SendKeys(user.LastName);
     UserEmail.SendKeys(user.UserEmail);
     RadioCheckbox[0].Click();
     UserNumber.SendKeys(user.UserNumber);
     DateOfBirth.Click();
     SelectJune.Click();
     SelectYear.Click();
     SelectDate[0].Click();
     //for (int i = 0; i < 11; i++)
     //{
     //    formPage.Subjects.SendKeys(Keys.Backspace);
     //}
     //formPage.DateOfBirth.SendKeys("01 02 1982");
     //formPage.DateOfBirth.SendKeys(Keys.Escape);
     Subjects.Click();
     Subjects.SendKeys(user.Subjects);
     RadioCheckbox[3].Click();
     Submit.Click();
 }
예제 #30
0
        public void TestPostBack_WhenMultipleSelected()
        {
            multiSelect.Checked = true;
            Submit.Click();

            AssertEquals("item #0", false, List.Items[0].Selected);
            List.Items[0].Selected = true;
            AssertEquals("item #0", false, List.Items[0].Selected);

            AssertEquals("item #1", true, List.Items[1].Selected);
            List.Items[1].Selected = false;
            AssertEquals("item #1", true, List.Items[1].Selected);

            autoPostBack.Checked = true;
            Submit.Click();

            AssertEquals("item #2", false, List.Items[2].Selected);
            List.Items[2].Selected = true;
            AssertEquals("item #2", true, List.Items[2].Selected);

            AssertEquals("item #2", true, List.Items[2].Selected);
            List.Items[2].Selected = false;
            AssertEquals("item #2", false, List.Items[2].Selected);
        }