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 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 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); } }
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); } }