private void SelectFundingType(string ftSelectionIndex)
 {
     findFormRTPage.ClickOnFTDropdown();
     ElementAccessors.Wait(2);
     findFormRTPage.ClickOnFundingTypeOption(int.Parse(ftSelectionIndex));
     ElementAccessors.Wait(2);
 }
 private void SelectOrganization(string orgTextActual, string orgSelectedIndex)
 {
     findFormRTPage.InputOrganizationTextBox(orgTextActual);
     ElementAccessors.Wait(2);
     findFormRTPage.ClickOnOrganization(int.Parse(orgSelectedIndex));
     ElementAccessors.Wait(2);
 }
 public void ClickOnCreateRequestButton()
 {
     try
     {
         ElementAccessors.DoClick(this.driver, CreateRequestButton);
     }
     catch (Exception)
     { throw; }
 }
 public void InputTeacherTextBox(string FTText)
 {
     try
     {
         ElementAccessors.InputTextBox(FTText, DropdownSearchTextBox);
     }
     catch (Exception)
     { throw; }
 }
 public void InputOrganizationTextBox(string orgText)
 {
     try
     {
         ElementAccessors.InputTextBox(orgText, OrganizationText);
     }
     catch (Exception)
     { throw; }
 }
Пример #6
0
 public void ClickOnMakeARequestButton()
 {
     try
     {
         ElementAccessors.DoClick(this.driver, MakeANewRequest);
         ElementAccessors.Wait(2);
     }
     catch (Exception)
     { throw; }
 }
        public void CreateRequest()
        {
            LoadFindFormRT();

            findFormRTPageData = RealTestData <FindFormRT> .GetTestData("FindFormRT", "TeacherSelectionIndex", "TestName='" + new StackFrame(0).GetMethod().Name + "'");

            findFormRTPage.ClickOnTeacherDropdown();
            ElementAccessors.Wait(5);
            findFormRTPage.ClickOnTeacherOption(int.Parse(findFormRTPageData[0].TeacherSelectionIndex));
            ElementAccessors.Wait(2);
            findFormRTPage.ClickOnCreateRequestButton();
        }
        public void SelectTeacherFromDropdown()
        {
            LoadFindFormRT();

            findFormRTPageData = RealTestData <FindFormRT> .GetTestData("FindFormRT", "*", "TestName='" + new StackFrame(0).GetMethod().Name + "'");

            findFormRTPage.ClickOnTeacherDropdown();
            ElementAccessors.Wait(5);
            foreach (FindFormRT findFormRT in findFormRTPageData)
            {
                SelectOrganization(findFormRT.OrgTextActual, findFormRT.OrgSelectionIndex);
                SelectFundingType(findFormRT.FTSelectionIndex);
                findFormRTPage.ClickOnTeacherOption(int.Parse(findFormRT.TeacherSelectionIndex));
            }
        }
        public void ClickOnOrganization(int elementIndex)
        {
            Random random = new Random();
            //int randomOrgIndx = random.Next(1, elementIndex);
            int randomOrgIndx = elementIndex;
            int idx           = 1;

            foreach (IWebElement webElement in OrgDropdownElements)
            {
                if (idx == randomOrgIndx)
                {
                    ElementAccessors.DoClick(this.driver, webElement);
                }
                idx++;
            }
        }
Пример #10
0
        public void TearDown()
        {
            TestStatus testStatus = TestContext.CurrentContext.Result.Outcome.Status;

            if (testStatus == TestStatus.Passed)
            {
                extentTest.Log(Status.Pass, "<pre>" + TestContext.CurrentContext.Test.Name + " Passed</pre>");
            }
            else if (testStatus == TestStatus.Failed)
            {
                var stackTrace   = "<pre>" + TestContext.CurrentContext.Result.StackTrace + "</pre>";
                var errorMessage = TestContext.CurrentContext.Result.Message;
                GetScreenShot.GetInstance().Capture(this.WebDriver, TestContext.CurrentContext.Test.Name);
                extentTest.AddScreenCaptureFromPath(GetScreenShot.GetInstance().ScreenshotPath + TestContext.CurrentContext.Test.Name + ".png");
                extentTest.Log(Status.Fail, stackTrace + errorMessage);
            }
            ElementAccessors.Wait(1);
            this.WebDriver.Quit();
        }
        public void ValidateOrgSearchResults()
        {
            List <string> lstDropdownElementsCaption;

            LoadFindFormRT();

            findFormRTPageData = RealTestData <FindFormRT> .GetTestData("FindFormRT", "OrgTextActual", "TestName='" + new StackFrame(0).GetMethod().Name + "'");

            foreach (FindFormRT findFormRT in findFormRTPageData)
            {
                findFormRTPage.InputOrganizationTextBox(findFormRT.OrgTextActual.Trim());
                ElementAccessors.Wait(2);
                lstDropdownElementsCaption = findFormRTPage.GetOrgDropdownElementsCaption();
                bool validationResult = ((lstDropdownElementsCaption.FindAll(caption => caption.ToUpper().Contains(findFormRT.OrgTextActual.Trim().ToUpper())).Count
                                          == lstDropdownElementsCaption.Count) ||
                                         lstDropdownElementsCaption.Contains(findFormRT.NoResultsFoundCaptionExpected.Trim()));
                Assert.AreEqual(true, validationResult);
            }
        }
Пример #12
0
 public void LogIn(string userName, string password)
 {
     try
     {
         if (AnotherUserLink.Displayed)
         {
             ElementAccessors.DoClick(this.driver, AnotherUserLink);
         }
     }
     catch (Exception)
     {  }
     finally
     {
         UserNameText.SendKeys(userName);
         PasswordText.SendKeys(password);
         ElementAccessors.Wait(4);
         ElementAccessors.DoClick(this.driver, SignInButton);
         ElementAccessors.Wait(4);
     }
 }