public void IsearchTheOrganization(string levelName) { try { switch (levelName) { case "District": string distName = DatabaseTools.GetOrganization(Enumerations.OrgLevelType.District).Trim(); new OrganizationManagementPage().SearchAndSelectOrg(distName); break; case "State": string stateName = DatabaseTools.GetOrganization(Enumerations.OrgLevelType.State).Trim(); new OrganizationManagementPage().SearchAndSelectOrg(stateName); break; case "School": string schoolName = DatabaseTools.GetOrganization(Enumerations.OrgLevelType.School).Trim(); new OrganizationManagementPage().SearchAndSelectOrg(schoolName); break; case "Region": string regionName = DatabaseTools.GetOrganization(Enumerations.OrgLevelType.Region).Trim(); new OrganizationManagementPage().SearchAndSelectOrg(regionName); break; } } catch (Exception e) { GenericHelper.Logs(e.ToString(), "FAILED"); ThenIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication(); throw new Exception(e.ToString()); } }
public void WhenICreatedTheUserAsStudent(Table table) { try { bool isWindowPresent = GenericHelper.IsPopUpWindowPresent("Manage Organization"); if (isWindowPresent) { GenericHelper.SelectWindow("Manage Organization"); WebDriver.SwitchTo().DefaultContent(); } else { // WebDriver.Close(); string schoolName = DatabaseTools.GetOrganization(Enumerations.OrgLevelType.School); _organizationManagement.SearchAndSelectOrg(schoolName); } // Purpose: To Create Users _manageUserPage.Createusers(table); } catch (Exception e) { GenericHelper.Logs(e.ToString(), "FAILED"); if (GenericHelper.IsPopUpWindowPresent("Manage Organization")) { GenericHelper.SelectWindow("Manage Organization"); WebDriver.Close(); } GenericDefinitions.ThenIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication(); throw new Exception(e.ToString()); } }
public void GoToManageOrganizationPage() { try { if (!GenericHelper.IsPopUpWindowPresent("Manage Organization")) { GenericHelper.SelectDefaultWindow(); GenericHelper.WaitUntilElement(By.Id("_ctl8__ctl11_Link")); IWebElement orgAdminLink = WebDriver.FindElement(By.Id("_ctl8__ctl11_Link")); orgAdminLink.Click(); string schoolName = DatabaseTools.GetOrganization(Enumerations.OrgLevelType.School); SearchAndSelectOrg(schoolName); } GenericHelper.SelectWindow("Manage Organization"); } catch (Exception e) { GenericHelper.Logs(e.ToString(), "FAILED"); bool isWindowPresentManageOrganization = GenericHelper.IsPopUpWindowPresent("Manage Organization"); if (isWindowPresentManageOrganization) { GenericHelper.SelectWindow("Manage Organization"); WebDriver.Close(); } throw new Exception(e.ToString()); } }
public void GivenISelectedTheDistrictLevelOfOrganization() { try { string distName = DatabaseTools.GetOrganization(Enumerations.OrgLevelType.District); _organizationManagement.SearchAndSelectOrg(distName); } catch (Exception e) { GenericHelper.Logs(e.ToString(), "FAILED"); GenericDefinitions.ThenIClickedOnTheLogoutLinkToGetLoggedOutFromTheApplication(); Thread.Sleep(3000); throw new Exception(e.ToString()); } }