Exemplo n.º 1
0
        public void ClickSubmitBtn()
        {
            IJavaScriptExecutor js = (IJavaScriptExecutor)driver;

            js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)");
            SubmitBtn.Click();
        }
Exemplo n.º 2
0
 public void Email_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SubmitBtn.PerformClick();
     }
 }
Exemplo n.º 3
0
 private void SearchText_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == System.Windows.Forms.Keys.Enter)
     {
         SubmitBtn.PerformClick();
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (AppraisedContainerView != null)
            {
                AppraisedContainerView.Dispose();
                AppraisedContainerView = null;
            }

            if (EditButton != null)
            {
                EditButton.Dispose();
                EditButton = null;
            }

            if (SubmitBtn != null)
            {
                SubmitBtn.Dispose();
                SubmitBtn = null;
            }

            if (SummaryContainerView != null)
            {
                SummaryContainerView.Dispose();
                SummaryContainerView = null;
            }

            if (valuemytrade != null)
            {
                valuemytrade.Dispose();
                valuemytrade = null;
            }
        }
Exemplo n.º 5
0
 private void RegisterWindow_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     // вход по Enter
     if (e.Key == Key.Enter)
     {
         SubmitBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
 }
 internal UltimateQAHomePage FillOutEmergenctDetails(TestUser emergencyContactUser)
 {
     SetGenderForEmergencyContact(emergencyContactUser);
     FirstNameFieldForEmergencyContact.SendKeys(emergencyContactUser.firstName);
     LastNameFieldForEmergencyContact.SendKeys(emergencyContactUser.lastName);
     SubmitBtn.Click();
     return(new UltimateQAHomePage(Driver));
 }
 internal UltimateQAHomePage FillOutPrimaryContactFormAndSubmit(TestUser user)
 {
     SetGender(user);
     FirstNameField.SendKeys(user.firstName);
     LastNameField.SendKeys(user.lastName);
     SubmitBtn.Click();
     return(new UltimateQAHomePage(Driver));
 }
Exemplo n.º 8
0
        private void tagCatCombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox cbx = (ComboBox)sender;

            if (cbx.Text != "")
            {
                Ticket.VehicleTagCategory = categories.FirstOrDefault(x => x.Value == cbx.Text).Key;
                SubmitBtn.Focus();
            }
        }
Exemplo n.º 9
0
        public void test()
        {
            // Focuses on small window to scroll
            PropertiesCollection.driver.SwitchTo().Frame(PropertiesCollection.driver.FindElement(By.Id("container")));

            // Implement javascript to scroll window
            IJavaScriptExecutor js = (IJavaScriptExecutor)PropertiesCollection.driver;

            js.ExecuteScript("window.scrollBy(0,200)");

            SetMethods.EnterText(TextBox, "Tosca");

            // Focus back on entire html page
            PropertiesCollection.driver.SwitchTo().DefaultContent();

            SubmitBtn.Click();
            Thread.Sleep(800);
            Assert.IsTrue(Completed.Text.Contains("Good job"), "Not Completed");
            ClosePopUp.Click();
        }
Exemplo n.º 10
0
        public void FillFormForOthers(string examinationPosition, string appleant, string fName, string mName, string lName, string aka,
                                      string lastFourSSN, string contactPhone, string mailingAddress, string city, string state, string zip,
                                      string email, string cEmail, string empNumber, string payroll, string department, string appealIssue,
                                      string remedy
                                      )
        {
            // SubmitAppeal.Clicks();
            BtnIAgree.Clicks();

            OtherHeadingID.Clicks();
            Others.Clicks();

            if (appleant == "Yourself")
            {
                FillingYourSelf.Click();
            }
            FName.EnterText(fName);
            MName.EnterText(mName);
            LName.EnterText(lName);
            Aka.EnterText(aka);
            LastFourSSN.EnterText(lastFourSSN);
            ContactPhone.EnterText(contactPhone);
            MailingAddress.EnterText(mailingAddress);
            City.EnterText(city);
            State.ClearText(state);
            ZipCode.EnterText(zip);
            PreferredEmail.EnterText(email);
            ConfirmEmail.EnterText(cEmail);
            EmployeeNumber.EnterText(empNumber);
            Payroll.EnterText(payroll);
            EmployingDepartment.EnterText(department);
            AppealIssue.EnterText(appealIssue);
            Remedy.SendKeys(remedy);
            SubmitBtn.Clicks();
            AcceptPopupBtn.Clicks();
        }
Exemplo n.º 11
0
 public void test()
 {
     GenerateBtn.Click();
     for (int i = 2; i < 7; i++)
     {
         IWebElement         letter     = PropertiesCollection.driver.FindElement(By.XPath("/html/body/div[2]/div[1]/div[1]/div[2]/div/div[2]/div[2]/div[2]/table/tr[" + i + "]/td[1]"));
         IWebElement         ddl        = PropertiesCollection.driver.FindElement(By.XPath("/html/body/div[2]/div[1]/div[1]/div[2]/div/div[2]/div[2]/div[2]/table/tr[" + i + "]/td[2]/select"));
         SelectElement       selectList = new SelectElement(ddl);
         IList <IWebElement> options    = selectList.Options;
         for (int j = 1; j < 6; j++)
         {
             string optionText = options[j].Text.ToString();
             if (CheckLetter(letter.Text).Equals(optionText.Substring(0, 1)))
             {
                 SetMethods.SelectDropDown(ddl, optionText);
                 break;
             }
         }
     }
     SubmitBtn.Click();
     Thread.Sleep(800);
     Assert.IsTrue(Completed.Text.Contains("Good job"), "Not Completed");
     ClosePopUp.Click();
 }
Exemplo n.º 12
0
        public void FillFormForDiscipline(string discipline, string examinationNumber, string examinationName, string appleant, string fName, string mName, string lName, string aka,
                                          string lastFourSSN, string contactPhone, string mailingAddress, string city, string state, string zip, string email, string cEmail, string empNumber,
                                          string payroll, string department, string appealIssue, string notificationDocument, string attachmentDesciption, string classificationDoc, string ClassificationDocDesc, string remedy
                                          )
        {
            // SubmitAppeal.Clicks();
            BtnIAgree.Clicks();

            DisciplineHeadingID.Clicks();
            if (discipline.Contains("1-5 day Suspension") || discipline.Contains("LayOff") ||
                discipline.Contains("Probationary Discharge") || discipline.Contains("Probationary Reduction") ||
                discipline.Contains("Reduction due to Lay-Off") || discipline.Contains("Release From Temporary Employment") ||
                discipline.Contains("Transfer") || discipline.Contains("Resignation"))
            {
                if (discipline.Contains("1-5 day Suspension"))
                {
                    Suspension.Clicks();
                }
                else if (discipline.Contains("LayOff"))
                {
                    LayOff.Clicks();
                }
                else if (discipline.Contains("Probationary Discharge"))
                {
                    ProbationaryDischarge.Clicks();
                }
                else if (discipline.Contains("Probationary Reduction"))
                {
                    ProbationaryReduction.Clicks();
                }
                else if (discipline.Contains("Reduction due to Lay-Off"))
                {
                    ReductionDueToLayOff.Clicks();
                }
                else if (discipline.Contains("Release From Temporary Employment"))
                {
                    ReleaseFromTemporaryEmployment.Clicks();
                }
                else if (discipline.Contains("Transfer"))
                {
                    Transfer.Clicks();
                }
                else if (discipline.Contains("Resignation"))
                {
                    Resignation.Clicks();
                }
                if (appleant.Contains("Yourself"))
                {
                    FillingYourSelf.Click();
                }
                FName.EnterText(fName);
                MName.EnterText(mName);
                LName.EnterText(lName);
                Aka.EnterText(aka);
                LastFourSSN.EnterText(lastFourSSN);
                ContactPhone.EnterText(contactPhone);
                MailingAddress.EnterText(mailingAddress);
                City.EnterText(city);
                State.ClearText(state);
                ZipCode.EnterText(zip);
                PreferredEmail.EnterText(email);
                ConfirmEmail.EnterText(cEmail);
                EmployeeNumber.EnterText(empNumber);
                Payroll.EnterText(payroll);
                EmployingDepartment.EnterText(department);
                AppealIssue.EnterText(appealIssue);
                Attach.Clicks();
                Browse.UploadFile(notificationDocument);
                AttachmentDescription.EnterText(attachmentDesciption);
                Remedy.SendKeys(remedy);
                SubmitBtn.Clicks();
                AcceptPopupBtn.Clicks();
            }

            else if (discipline.Contains("ClassificationStudy"))
            {
                ClassificationStudy.Clicks();
                ExaminationNumber.SendKeys(examinationNumber);
                ExaminationName.SendKeys(examinationName);
                if (appleant == "Yourself")
                {
                    FillingYourSelf.Click();
                }
                FName.EnterText(fName);
                MName.EnterText(mName);
                LName.EnterText(lName);
                Aka.EnterText(aka);
                LastFourSSN.EnterText(lastFourSSN);
                ContactPhone.EnterText(contactPhone);
                MailingAddress.EnterText(mailingAddress);
                City.EnterText(city);
                State.ClearText(state);
                ZipCode.EnterText(zip);
                PreferredEmail.EnterText(email);
                ConfirmEmail.EnterText(cEmail);
                EmployeeNumber.EnterText(empNumber);
                Payroll.EnterText(payroll);
                EmployingDepartment.EnterText(department);
                AppealIssue.EnterText(appealIssue);
                Attach.Clicks();
                Browse.UploadFile(notificationDocument);
                AttachmentDescription.EnterText(attachmentDesciption);
                AttachAdditional.Clicks();
                BrowseAdditional.UploadFile(classificationDoc);
                DescriptionAdditional.EnterText(ClassificationDocDesc);
                Remedy.SendKeys(remedy);
                SubmitBtn.Clicks();
                AcceptPopupBtn.Clicks();
            }
        }
Exemplo n.º 13
0
        public void FillFormForDisqualification(string disqulificationType, string examinationNumber, string examinationName, string appleant, string fName, string mName, string lName, string aka,
                                                string lastFourSSN, string contactPhone, string mailingAddress, string city, string state, string zip, string email, string cEmail, string empNumber,
                                                string payroll, string department, string appealIssue, string documentLocation, string attachmentDesciption, string authDoc, string authDocDesc, string remedy
                                                )
        {
            //SubmitAppeal.Clicks();
            BtnIAgree.Clicks();

            DisqualificatioHeadingID.Clicks();
            if (disqulificationType.Contains("Background"))
            {
                Background.Clicks();


                ExaminationNumber.SendKeys(examinationNumber);
                ExaminationName.SendKeys(examinationName);
                if (appleant == "Yourself")
                {
                    FillingYourSelf.Click();
                }
                waitForPageUntilElementIsVisible(By.Id("x-auto-0-input"), 20);
                FName.EnterText(fName);
                MName.EnterText(mName);
                LName.EnterText(lName);
                Aka.EnterText(aka);
                LastFourSSN.EnterText(lastFourSSN);
                ContactPhone.EnterText(contactPhone);
                MailingAddress.EnterText(mailingAddress);
                City.EnterText(city);
                State.ClearText(state);
                ZipCode.EnterText(zip);
                PreferredEmail.EnterText(email);
                ConfirmEmail.EnterText(cEmail);
                EmployeeNumber.EnterText(empNumber);
                Payroll.EnterText(payroll);
                EmployingDepartment.EnterText(department);
                AppealIssue.EnterText(appealIssue);
                Attach.Clicks();
                Browse.UploadFile(documentLocation);
                AttachmentDescription.EnterText(attachmentDesciption);
                Remedy.SendKeys(remedy);
                SubmitBtn.Clicks();
                AcceptPopupBtn.Clicks();
            }
            else if (disqulificationType.Contains("Inaccurate Disclosure"))
            {
                InaccurateDisclosure.Clicks();

                ExaminationNumber.SendKeys(examinationNumber);
                ExaminationName.SendKeys(examinationName);
                if (appleant == "Yourself")
                {
                    FillingYourSelf.Click();
                }
                waitForPageUntilElementIsVisible(By.Id("x-auto-0-input"), 10);
                FName.EnterText(fName);
                waitForPageUntilElementIsVisible(By.Id("x-auto-1-input"), 10);
                MName.EnterText(mName);
                LName.EnterText(lName);
                Aka.EnterText(aka);
                LastFourSSN.EnterText(lastFourSSN);
                ContactPhone.EnterText(contactPhone);
                MailingAddress.EnterText(mailingAddress);
                City.EnterText(city);
                State.ClearText(state);
                ZipCode.EnterText(zip);
                PreferredEmail.EnterText(email);
                ConfirmEmail.EnterText(cEmail);
                EmployeeNumber.EnterText(empNumber);
                Payroll.EnterText(payroll);
                EmployingDepartment.EnterText(department);
                AppealIssue.EnterText(appealIssue);
                Attach.Clicks();
                Browse.UploadFile(documentLocation);
                AttachmentDescription.EnterText(attachmentDesciption);
                AttachAdditional.Clicks();
                BrowseAdditional.UploadFile(authDoc);
                DescriptionAdditional.EnterText(authDocDesc);
                Remedy.SendKeys(remedy);
                SubmitBtn.Clicks();
                AcceptPopupBtn.Clicks();
            }
        }
Exemplo n.º 14
0
        public void FillFormForPosition(string examinationPosition, string examinationNumber, string examinationName, string appleant, string fName, string mName, string lName, string aka,
                                        string lastFourSSN, string contactPhone, string mailingAddress, string city, string state, string zip, string email, string cEmail, string empNumber,
                                        string payroll, string department, string appealIssue, string document, string attachmentDesciption, string remedy
                                        )
        {
            // SubmitAppeal.Clicks();
            BtnIAgree.Clicks();

            PositionHeadingID.Clicks();
            if (examinationPosition == "Application Reject")
            {
                ApplicationRejection.Clicks();
            }
            else if (examinationPosition == "Appraisal of Promotability")
            {
                AppraisalOfPromotability.Clicks();
            }
            else if (examinationPosition == "Evaluation of Training and Experience")
            {
                EvaluationOfTraining.Clicks();
            }
            else if (examinationPosition == "Interview")
            {
                Interview.Clicks();
            }
            else if (examinationPosition == "Performance Test")
            {
                PerformanceTest.Clicks();
            }
            else if (examinationPosition == "Veteran Credit")
            {
                VeteranCredit.Clicks();
            }
            else if (examinationPosition == "Paper-and-Pencil Written Tests")
            {
                WrittenTests.Clicks();
            }
            else if (examinationPosition == "Computer-Administered Tests")
            {
                ComputerAdministeredTests.Clicks();
            }

            ExaminationNumber.SendKeys(examinationNumber);
            ExaminationName.SendKeys(examinationName);
            if (appleant == "Yourself")
            {
                FillingYourSelf.Click();
            }
            FName.EnterText(fName);
            MName.EnterText(mName);
            LName.EnterText(lName);
            Aka.EnterText(aka);
            LastFourSSN.EnterText(lastFourSSN);
            ContactPhone.EnterText(contactPhone);
            MailingAddress.EnterText(mailingAddress);
            City.EnterText(city);
            State.ClearText(state);
            ZipCode.EnterText(zip);
            PreferredEmail.EnterText(email);
            ConfirmEmail.EnterText(cEmail);
            EmployeeNumber.EnterText(empNumber);
            Payroll.EnterText(payroll);
            EmployingDepartment.EnterText(department);
            AppealIssue.EnterText(appealIssue);
            Attach.Clicks();
            Browse.UploadFile(document);
            AttachmentDescription.EnterText(attachmentDesciption);
            Remedy.SendKeys(remedy);
            SubmitBtn.Clicks();
            AcceptPopupBtn.Clicks();
        }
Exemplo n.º 15
0
        /// <summary>
        /// Clicks the user-specified element and then waits for a window to close or open, or a page to load,
        /// depending on the element that was clicked
        /// </summary>
        /// <param name="buttonOrLinkElem">The button element</param>
        public void ClickAndWait(IWebElement buttonOrLinkElem)
        {
            // Error handler to make sure that the button that the tester passed in the parameter is actually on the page
            if (Browser.Exists(Bys.DiplomaTraineePage.BackToDashboardBtn))
            {
                // This is a workaround to be able to use an IF statement on an IWebElement type.
                if (buttonOrLinkElem.GetAttribute("outerHTML") == BackToDashboardBtn.GetAttribute("outerHTML"))
                {
                    ElemSet.ClickAfterScroll(Browser, buttonOrLinkElem);
                    this.WaitUntil(Criteria.DiplomaTraineePage.MainFrameVisibleAndEnabled);
                    Browser.SwitchTo().Frame(MainFrame);
                    this.WaitUntil(Criteria.DiplomaTraineePage.MilestonesTblVisible);
                    return;
                }
            }

            if (Browser.Exists(Bys.DiplomaTraineePage.SubmitMilestoneFormSubmitBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == SubmitMilestoneFormSubmitBtn.GetAttribute("outerHTML"))
                {
                    ElemSet.ClickAfterScroll(Browser, buttonOrLinkElem);
                    this.WaitUntil(Criteria.DiplomaTraineePage.MainFrameVisibleAndEnabled);
                    Browser.SwitchTo().Frame(MainFrame);
                    this.WaitUntil(Criteria.DiplomaTraineePage.MilestonesTblVisible);
                    return;
                }
            }

            if (Browser.Exists(Bys.DiplomaTraineePage.MilestonesInMilestonesTblLnks))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == MilestonesInMilestonesTblLnks[0].GetAttribute("outerHTML"))
                {
                    ElemSet.ClickAfterScroll(Browser, buttonOrLinkElem);
                    WaitForMilestoneFrame();
                    return;
                }
            }

            if (Browser.Exists(Bys.DiplomaTraineePage.ResubmitBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == ResubmitBtn.GetAttribute("outerHTML"))
                {
                    ElemSet.ClickAfterScroll(Browser, buttonOrLinkElem);
                    this.WaitUntil(Criteria.DiplomaTraineePage.MainFrameVisibleAndEnabled);
                    Browser.SwitchTo().Frame(MainFrame);
                    this.WaitUntil(Criteria.DiplomaTraineePage.MilestonesTblVisible);
                    return;
                }
            }

            if (Browser.Exists(Bys.DiplomaTraineePage.EvidForAchieveFormDoneBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == EvidForAchieveFormDoneBtn.GetAttribute("outerHTML"))
                {
                    ElemSet.ClickAfterScroll(Browser, buttonOrLinkElem);
                    this.WaitUntil(Criteria.DiplomaTraineePage.UploadedFileLnkVisible);
                    return;
                }
            }

            if (Browser.Exists(Bys.DiplomaTraineePage.YourReplySaveChangesBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == YourReplySaveChangesBtn.GetAttribute("outerHTML"))
                {
                    ElemSet.ClickAfterScroll(Browser, buttonOrLinkElem);
                    // Add a better wait here. Note that waiting for the save changes button to not be visible doesnt work for some reason
                    Thread.Sleep(2000);
                    return;
                }
            }

            if (Browser.Exists(Bys.DiplomaTraineePage.DescriptionSaveChangesBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == DescriptionSaveChangesBtn.GetAttribute("outerHTML"))
                {
                    ElemSet.ClickAfterScroll(Browser, buttonOrLinkElem);
                    this.WaitUntil(Criteria.DiplomaTraineePage.DescriptionSaveChangesButtonNotExists);
                    return;
                }
            }

            if (Browser.Exists(Bys.DiplomaTraineePage.SubmitBtn))
            {
                // Using offsetleft here instead of outerHTML because this button and SubmitPortfolioFormSubmitBtn have the same outerHTML
                if (buttonOrLinkElem.GetAttribute("offsetLeft") == SubmitBtn.GetAttribute("offsetLeft"))
                {
                    ElemSet.ClickAfterScroll(Browser, buttonOrLinkElem);
                    this.WaitUntil(Criteria.DiplomaTraineePage.SubmitMilestoneFormSelectReviewerSelElemIsVisibleHasItems);
                    return;
                }
            }

            if (Browser.Exists(Bys.DiplomaTraineePage.SubmitPortfolioFormSubmitBtn))
            {
                if (buttonOrLinkElem.GetAttribute("offsetLeft") == SubmitPortfolioFormSubmitBtn.GetAttribute("offsetLeft"))
                {
                    ElemSet.ClickAfterScroll(Browser, buttonOrLinkElem);
                    this.WaitUntil(Criteria.DiplomaTraineePage.SubmitPortfolioFormSubmitBtnNotVisible);
                    return;
                }
            }

            if (Browser.Exists(Bys.DiplomaTraineePage.SubmitPortfolioBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == SubmitPortfolioBtn.GetAttribute("outerHTML"))
                {
                    ElemSet.ClickAfterScroll(Browser, buttonOrLinkElem);
                    this.WaitUntilAll(Criteria.DiplomaTraineePage.SubmitPortfolioFormSubmitBtnVisible);
                    return;
                }
            }

            else
            {
                throw new Exception("No button or link was found with your passed parameter. You either need to add this button to a new If statement, " +
                                    "or if the button is already added, then the page you were on did not contain the button.");
            }
        }