예제 #1
0
        public static void NavigateToMailboxPage(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);
                    ExgOrgMailboxes orgMailboxes = exgHome.MailboxesHome();
                }

                else if (DriverContext.Driver.FindElement(By.XPath("//h2")).Text != "Manage Mailboxes" && !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);
                    ExgOrgMailboxes orgMailboxes = exgHome.MailboxesHome();
                }
            }

            catch (Exception e)
            {
                LogClass.AppendLogs(e);
            }
        }
예제 #2
0
        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);
            }
        }