public static void NavigateToDlPage(TestContext testContext) { string organizationName = Convert.ToString(testContext.DataRow["OrganizationName"]); try { SetDriverTime(2); if (DriverContext.Driver.FindElements(By.XPath("//h2")).Count == 0) { SetDriverTime(30); HomePage home = new HomePage(); home.ClickProvisioning(); ExchangeHome exgHome = home.ClickExchangeHome(); exgHome.SearchOrganizationName(organizationName); exgHome.DistributionListsHome(); } else if (DriverContext.Driver.FindElement(By.XPath("//h2")).Text != "Manage Distribution Lists" && !DriverContext.Driver.FindElement(By.XPath("//p")).Text.Contains(organizationName)) { SetDriverTime(30); PageRefresh(DriverContext.Driver); //Act HomePage home = new HomePage(); home.ClickProvisioning(); ExchangeHome exgHome = home.ClickExchangeHome(); exgHome.SearchOrganizationName(organizationName); exgHome.DistributionListsHome(); } } catch (Exception) { } }
public string EnableMailbox(TestContext testContext) { try { //Arrange string organizationName = Convert.ToString(testContext.DataRow["OrganizationName"]); string email = Convert.ToString(testContext.DataRow["Email"]); string displayName = Convert.ToString(testContext.DataRow["DisplayName"]); //Act HomePage home = new HomePage(); home.ClickProvisioning(); ExchangeHome exgHome = home.ClickExchangeHome(); exgHome.SearchOrganizationName(organizationName); ExgOrgMailboxes orgMailboxes = exgHome.MailboxesHome(); orgMailboxes.SearchMailboxName(email, displayName); return(orgMailboxes.DisableMailbox()); } catch (Exception ex) { LogClass.AppendLogs(ex); return(null); } }