コード例 #1
0
 public string SetArchive(string archiveSize, bool isCR)
 {
     try
     {
         btnAddUserArchiveElem.Click();
         SeleniumHelperMethods.WaitExpectedConditionsClickable(DriverContext.Driver, btnCreateArchiveMailbox);
         if (isCR == true)
         {
             SeleniumHelperMethods.SelectDropDownValue(dropdownCRElem, archiveSize);
         }
         else
         {
             SeleniumHelperMethods.SelectDropDownValue(dropdownCRElem, "I'll choose my own offering");
             SetCheckBox(ckbxArchiveMailboxSize, false);
             txtArchiveMailboxSizeElem.Clear();
             txtArchiveMailboxSizeElem.SendKeys(archiveSize);
             txtArchiveWarningLevelElem.Clear();
             txtArchiveWarningLevelElem.SendKeys(Convert.ToString(Convert.ToInt64(archiveSize) - 1));
         }
         DriverContext.Driver.FindElement(By.XPath("//*[@id='ArchiveQuotaValue']/label/input")).Click();
         btnCreateArchiveMailbox.Click();
         return(GetPrompt(headerProgressElem, headerProgressElemBy,
                          MessageContainer.DialogeContainer));
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
コード例 #2
0
        public string SetAdvanceProperties(bool isCR, string mailboxSize, bool isHiddenFromAddressBook, bool isImapEnabled, bool isPopEnabled, bool isOwaEnabled, bool isMapiEnabled)
        {
            try
            {
                SetCheckBox(ckbxHideFromAddressBookElem, isHiddenFromAddressBook);

                if (isCR == true)
                {
                    SeleniumHelperMethods.SelectDropDownValue(dropdownCRElem, mailboxSize);
                }

                else
                {
                    SeleniumHelperMethods.SelectDropDownValue(dropdownCRElem, accumulatedQuota);

                    SetCheckBox(ckbxImapElem, isImapEnabled);
                    SetCheckBox(ckbxPopElem, isPopEnabled);
                    SetCheckBox(ckbxOwaElem, isOwaEnabled);
                    SetCheckBox(ckbxMapiElem, isMapiEnabled);
                    SetResourceMailboxSize(mailboxSize);
                }

                btnUpdateAdvProp.Click();
                return(GetPrompt(headerProgressElem, headerProgressElemBy, MessageContainer.ToastContainer));
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }
コード例 #3
0
        public string AddMembersInDl(IWebDriver driver, string userList)
        {
            try
            {
                driver.SwitchTo().Window(driver.WindowHandles.Last());
                var members = userList.Split(' ');
                foreach (var member in members)
                {
                    var _member = member.Split(';');
                    SeleniumHelperMethods.SelectDropDownValue(driver.FindElement(By.XPath("//*[@id='RecipientType']")), _member[0]);
                    driver.FindElement(By.XPath(
                                           "//input[@type = 'checkbox' and contains(@value, '" + _member[1] + "')]"))
                    .Click();
                    driver.FindElement(By.XPath("//button[contains(text(),'Add')]")).Click();
                }


                driver.FindElement(By.XPath("//button[contains(text(),'Select Objects')]")).Click();
                driver.SwitchTo().Window(driver.WindowHandles.First());
                return("success");
            }
            catch (NoSuchElementException)
            {
                return(ErrorDescriptions.ErrorAddingUserinPopUp);
            }
            catch (Exception e)
            {
                return(e.Message.Trim());
            }
        }
コード例 #4
0
        public string CreatePublicFolder(string publicFolderName, string publicFolderType, bool isMailEnable,
                                         string email, string publicFolderMailbox, string publicFolderSize, bool isCr)
        {
            if (!SeleniumHelperMethods.WaitExpectedConditionsClickable(DriverContext.Driver, btnCreatePublicFolder))
            {
                return(ErrorDescriptions.CreateButtonTimeout);
            }
            try
            {
                txtPublicFolderNameElem.SendKeys(publicFolderName);


                MailAddress addr       = new MailAddress(email);
                string      userName   = addr.User;
                string      mailDomain = addr.Host;
                txtEmailAddressElem.SendKeys(userName);


                if (publicFolderType != "Mail")
                {
                    SeleniumHelperMethods.SelectDropDownValue(dropdownPublicFolderTyoeElem, publicFolderType);
                }

                if (isMailEnable == true)
                {
                    if (ckbxPFMailEnableElem.Selected)
                    {
                    }
                    else
                    {
                        ckbxPFMailEnableElem.Click();
                    }
                }

                if (!string.IsNullOrEmpty(publicFolderMailbox))
                {
                    SeleniumHelperMethods.SelectDropDownValue(dropdownPFMailboxElem, publicFolderMailbox);
                }

                if (isCr == true)
                {
                    SeleniumHelperMethods.SelectDropDownValue(dropdownCRElem, publicFolderSize);
                }

                else
                {
                    if (ckbxSetQuotaElem.Selected)
                    {
                        ckbxPFMailEnableElem.Click();
                    }
                    txtSetQuotaElem.Clear();
                    txtSetQuotaElem.SendKeys(publicFolderSize);
                }

                Thread.Sleep(2000);
                btnCreatePublicFolder.Click();



                return(GetPrompt(headerProgressElem, headerProgressElemBy, MessageContainer.DialogeContainer));
            }



            catch (Exception e)
            {
                return(e.Message.Trim());
            }
        }
コード例 #5
0
        public string SetAdvanceProperties(string newDisplayName, bool hideFromAddessList,
                                           bool sendOofMessagetoOriginator, bool sendersInsideandOutsideOrg, string deliveryReport, string notes, string incomingMessageSize, bool IsCR)
        {
            try
            {
                if (newDisplayName != null)
                {
                    txtDLDisplayNameElem.Clear();
                    txtDLDisplayNameElem.SendKeys(newDisplayName);
                }


                if (hideFromAddessList == true)
                {
                    if (!isHideFromListElem.Selected)
                    {
                        isHideFromListElem.Click();
                    }
                }
                else
                {
                    if (isHideFromListElem.Selected)
                    {
                        isHideFromListElem.Click();
                    }
                }

                if (sendOofMessagetoOriginator == true)
                {
                    if (!IsSendOutToOriginatorElem.Selected)
                    {
                        IsSendOutToOriginatorElem.Click();
                    }
                }
                else
                {
                    if (IsSendOutToOriginatorElem.Selected)
                    {
                        IsSendOutToOriginatorElem.Click();
                    }
                }

                if (sendersInsideandOutsideOrg == true)
                {
                    if (!IsAllSenderAuthenticatedElem.Selected)
                    {
                        IsAllSenderAuthenticatedElem.Click();
                    }
                }
                else
                {
                    if (IsAllSenderAuthenticatedElem.Selected)
                    {
                        IsAllSenderAuthenticatedElem.Click();
                    }
                }

                switch (deliveryReport)
                {
                case "Report to Manager":
                    radioReportToManagerElem.Click();
                    break;

                case "Report to Originator":
                    radioReportToOriginatorElem.Click();
                    break;

                case "No Delivery Report":
                    radioNoReportElem.Click();
                    break;
                }

                if (notes != null)
                {
                    textAreaNotesElem.Clear();
                    textAreaNotesElem.SendKeys(notes);
                }

                if (incomingMessageSize != null)
                {
                    if (IsCR == true)
                    {
                        SeleniumHelperMethods.SelectDropDownValue(dropdownCRElem, incomingMessageSize);
                    }
                    else
                    {
                        SeleniumHelperMethods.SelectDropDownValue(dropdownCRElem, "I'll choose my own offering");
                        if (ckbxIncomingMessageSizeElem.Selected)
                        {
                            ckbxIncomingMessageSizeElem.Click();
                        }
                        txtIncomingMessageSizeElem.Clear();
                        txtIncomingMessageSizeElem.SendKeys(incomingMessageSize);
                    }
                }


                btnAddAdvancePropertie.Click();
                return(GetPrompt(headerProgressElem, headerProgressElemBy,
                                 MessageContainer.ToastContainer));
            }
            catch (Exception ex)
            {
                return(ex.Message.Trim());
            }
        }
コード例 #6
0
        public string CreateResourceMailbox(string resourceType, bool isSubOU, string email, bool isCR, string mailboxSize, string firstname, string lastName, string displayName, string country, string state, string officeLocation, string address, string city, string zipCode, string jobTitle, string company, string department, string businessPhone, string
                                            fax, string homePhone, string mobilePhone, string pager, string notes)
        {
            try
            {
                SeleniumHelperMethods.WaitExpectedConditionsClickable(DriverContext.Driver, btnCreateResourceMailboxElem);

                MailAddress addr       = new MailAddress(email);
                string      userName   = addr.User;
                string      mailDomain = addr.Host;
                txtEmailPrefixElem.SendKeys(userName);


                if (resourceType == "Equipment")
                {
                    SeleniumHelperMethods.SelectDropDownValue(dropdownMailboxTypeElem, "Equipment");
                }

                if (isSubOU == true)
                {
                    SelectSubOU(DriverContext.Driver, lnkSubOUElem, subOUWaitElem, subOUWaitBy);
                }


                if (isCR == true)
                {
                    SeleniumHelperMethods.SelectDropDownValue(dropdownCRElem, mailboxSize);
                }

                else
                {
                    SetResourceMailboxSize(mailboxSize);
                }


                if (firstname != null || lastName != null || displayName != null || country != null || state != null || officeLocation != null || address != null || city != null || zipCode != null || jobTitle != null || company != null || department != null || businessPhone != null || fax != null || homePhone != null || mobilePhone != null || pager != null || notes != null)
                {
                    btnUserProfileElem.Click();
                    if (firstname != null)
                    {
                        txtFirstNameElem.SendKeys(firstname);
                    }
                    if (lastName != null)
                    {
                        txtLastNameElem.SendKeys(lastName);
                    }
                    if (displayName != null)
                    {
                        txtDisplayNameElem.SendKeys(displayName);
                    }

                    //if (country != null)
                    //{
                    //    SetCountryAndState(country, state);
                    //}

                    if (officeLocation != null)
                    {
                        txtGeneralProfileOfficeLocationElem.Clear();
                        txtGeneralProfileOfficeLocationElem.SendKeys(officeLocation);
                    }

                    if (address != null)
                    {
                        txtGeneralProfileStreetAddressElem.Clear();
                        txtGeneralProfileStreetAddressElem.SendKeys(address);
                    }

                    if (city != null)
                    {
                        txtGeneralProfileCityElem.Clear();
                        txtGeneralProfileCityElem.SendKeys(city);
                    }

                    if (zipCode != null)
                    {
                        txtGeneralProfileZipCodeElem.Clear();
                        txtGeneralProfileZipCodeElem.SendKeys(zipCode);
                    }

                    if (jobTitle != null)
                    {
                        txtGeneralProfileJobTitleElem.Clear();
                        txtGeneralProfileJobTitleElem.SendKeys(jobTitle);
                    }

                    if (company != null)
                    {
                        txtxGeneralProfileCompanyElem.Clear();
                        txtxGeneralProfileCompanyElem.SendKeys(company);
                    }

                    if (department != null)
                    {
                        txtGeneralProfileDepartmentElem.Clear();
                        txtGeneralProfileDepartmentElem.SendKeys(department);
                    }



                    if (businessPhone != null)
                    {
                        txtGeneralProfileBusinessPhoneElem.Clear();
                        txtGeneralProfileBusinessPhoneElem.SendKeys(businessPhone);
                    }

                    if (fax != null)
                    {
                        txtGeneralProfileFaxElem.Clear();
                        txtGeneralProfileFaxElem.SendKeys(fax);
                    }

                    if (homePhone != null)
                    {
                        txtGeneralProfileHomePhoneElem.Clear();
                        txtGeneralProfileHomePhoneElem.SendKeys(homePhone);
                    }

                    if (mobilePhone != null)
                    {
                        txtGeneralProfileMobilePhoneElem.Clear();
                        txtGeneralProfileMobilePhoneElem.SendKeys(mobilePhone);
                    }

                    if (pager != null)
                    {
                        txtGeneralProfilePagerElem.Clear();
                        txtGeneralProfilePagerElem.SendKeys(pager);
                    }

                    if (notes != null)
                    {
                        txtGeneralProfileNotesElem.Clear();
                        txtGeneralProfileNotesElem.SendKeys(notes);
                    }
                }

                Thread.Sleep(2000);
                btnCreateResourceMailboxElem.Click();
                //PageRefresh(DriverContext.Driver);

                return(GetPrompt(headerProgressElem, headerProgressElemBy, MessageContainer.DialogeContainer));
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
コード例 #7
0
        public string CreateDl(string groupType, bool isSubOU, bool isNewGroup, string adGroupName, string email,
                               string incomingMessageSize, bool isCR, string displayName, string adminUsers,
                               string memberUsers, bool allSendersAuth)
        {
            try
            {
                SeleniumHelperMethods.WaitExpectedConditionsClickable(DriverContext.Driver, btnCreateLDElemElem);

                switch (groupType)
                {
                case "Distribution":
                    radioDistributionElem.Click();
                    break;

                case "Security":
                    radioSecurityElem.Click();
                    break;

                case "Dynamic":
                    radioDynamicDLElem.Click();
                    break;
                }
                if (isSubOU == true)
                {
                    if (!SelectSubOU(DriverContext.Driver, lnkSubOUElem, subOUWaitElem,
                                     subOUWaitBy))
                    {
                        return(ErrorDescriptions.ErrorSubOuNotFound);
                    }
                }

                if (isNewGroup)
                {
                    txtDLDisplayNameElem.SendKeys(displayName);
                }
                else
                {
                    radioExistingDLElem.Click();
                    btnChooseExistingElem.Click();
                    SelectExistingObject(DriverContext.Driver, adGroupName);
                }

                MailAddress addr       = new MailAddress(email);
                string      userName   = addr.User;
                string      mailDomain = addr.Host;
                txtDLEmailAddressElem.Clear();
                txtDLEmailAddressElem.SendKeys(userName);



                if (groupType == "Distribution" || groupType == "Security")
                {
                    AddDlMembers(memberUsers);
                    if (allSendersAuth)
                    {
                        ckbxIsAllSenderAuthenticatedElem.Click();
                    }
                }

                AddDlAdministrators(adminUsers);


                if (isCR == true)
                {
                    SeleniumHelperMethods.SelectDropDownValue(dropdownCRElem, incomingMessageSize);
                }
                else
                {
                    if (ckbxUnlimitedMessageSize.Selected == true)
                    {
                        ckbxUnlimitedMessageSize.Click();
                    }
                    txtUnlimitedMessageSize.Clear();
                    txtUnlimitedMessageSize.SendKeys(incomingMessageSize);
                }

                Thread.Sleep(2000);
                btnCreateLDElemElem.Click();
                //PageRefresh(DriverContext.Driver);

                return(GetPrompt(headerProgressElem, headerProgressElemBy, MessageContainer.DialogeContainer));
            }
            catch (Exception e)
            {
                return(e.Message.Trim());
            }
        }
コード例 #8
0
 private void SetObjectViewLimit(string def = "100")
 {
     SeleniumHelperMethods.SelectDropDownValue(dropdownRecsPerPage, def);
 }
コード例 #9
0
        //private IWebElement btnCloseDialogueBox =>
        //ByXPath("//button[contains(text(), 'Cancel') and contains(@onclick, 'Layout.CloseModelDialog()')]");

        public string CreateMailbox(string mailboxType, bool isSubOU, bool newUser, string email, string mailboxPassword, bool isCR, string mailboxSize, bool passwordChange, string firstname, string lastName, string displayName, string country, string state, string officeLocation, string address, string city, string zipCode, string jobTitle, string company, string department, string managedBy, string businessPhone, string
                                    fax, string homePhone, string mobilePhone, string pager, string notes)
        {
            try
            {
                if (!SeleniumHelperMethods.WaitExpectedConditionsClickable(DriverContext.Driver, btnCreateMailboxElem))
                {
                    return(ErrorDescriptions.CreateButtonTimeout);
                }

                if (mailboxType == "Shared")
                {
                    if (!SeleniumHelperMethods.SelectDropDownValue(dropdownMailboxTypeElem, "Shared Mailbox"))
                    {
                        return(ErrorDescriptions.ErrorDropdownMenu);
                    }
                }

                if (isSubOU == true)
                {
                    if (!SelectSubOU(DriverContext.Driver, lnkSubOUElem, subOUWaitElem,
                                     subOUWaitBy))
                    {
                        return(ErrorDescriptions.ErrorSubOuNotFound);
                    }
                }


                if (newUser == true)
                {
                    MailAddress addr       = new MailAddress(email);
                    string      userName   = addr.User;
                    string      mailDomain = addr.Host;
                    txtEmailPrefixElem.SendKeys(userName);
                    //SeleniumHelperMethods.SelectDropDownValue(dropdownMailDomain, mailDomain);
                    txtPasswordElem.SendKeys(mailboxPassword);
                    txtConfirmPasswordElem.SendKeys(mailboxPassword);
                }

                else
                {
                    radioExistingUserElem.Click();
                    btnChooseExistingElem.Click();
                    try
                    {
                        SelectExistingObject(DriverContext.Driver, email);
                    }
                    catch (NoSuchElementException)
                    {
                        return(ErrorDescriptions.ErrorUserNotFound);
                    }
                }

                if (isCR == true)
                {
                    if (!SeleniumHelperMethods.SelectDropDownValue(dropdownCRElem, mailboxSize))
                    {
                        return(ErrorDescriptions.ErrorSelectingCR);
                    }
                }

                else
                {
                    SetMailboxSize(mailboxSize);
                }

                if (passwordChange == true)
                {
                    ckbxChangePasswordElem.Click();
                }

                if (firstname != null || lastName != null || displayName != null || country != null || state != null || officeLocation != null || address != null || city != null || zipCode != null || jobTitle != null || company != null || department != null || managedBy != null || businessPhone != null || fax != null || homePhone != null || mobilePhone != null || pager != null || notes != null)
                {
                    btnUserProfileElem.Click();

                    if (!string.IsNullOrEmpty(firstname))
                    {
                        txtFirstNameElem.Clear();
                        txtFirstNameElem.SendKeys(firstname);
                    }

                    if (!string.IsNullOrEmpty(lastName))
                    {
                        txtLastNameElem.Clear();
                        txtLastNameElem.SendKeys(lastName);
                    }

                    if (!string.IsNullOrEmpty(displayName))
                    {
                        txtDisplayNameElem.Clear();
                        txtDisplayNameElem.SendKeys(displayName);
                    }

                    //if (country != null)
                    //{
                    //    SetCountryAndState(country, state);
                    //}

                    if (!string.IsNullOrEmpty(officeLocation))
                    {
                        txtGeneralProfileOfficeLocationElem.Clear();
                        txtGeneralProfileOfficeLocationElem.SendKeys(officeLocation);
                    }

                    if (!string.IsNullOrEmpty(address))
                    {
                        txtGeneralProfileStreetAddressElem.Clear();
                        txtGeneralProfileStreetAddressElem.SendKeys(address);
                    }

                    if (!string.IsNullOrEmpty(city))
                    {
                        txtGeneralProfileCityElem.Clear();
                        txtGeneralProfileCityElem.SendKeys(city);
                    }

                    if (!string.IsNullOrEmpty(zipCode))
                    {
                        txtGeneralProfileZipCodeElem.Clear();
                        txtGeneralProfileZipCodeElem.SendKeys(zipCode);
                    }

                    if (!string.IsNullOrEmpty(jobTitle))
                    {
                        txtGeneralProfileJobTitleElem.Clear();
                        txtGeneralProfileJobTitleElem.SendKeys(jobTitle);
                    }

                    if (!string.IsNullOrEmpty(company))
                    {
                        txtxGeneralProfileCompanyElem.Clear();
                        txtxGeneralProfileCompanyElem.SendKeys(company);
                    }

                    if (!string.IsNullOrEmpty(department))
                    {
                        txtGeneralProfileDepartmentElem.Clear();
                        txtGeneralProfileDepartmentElem.SendKeys(department);
                    }

                    if (!string.IsNullOrEmpty(managedBy))
                    {
                        try
                        {
                            btnAddManagerElem.Click();
                            DriverContext.Driver.SwitchTo().Window(DriverContext.Driver.WindowHandles.Last());
                            DriverContext.Driver.FindElement(By.XPath("//input[contains(@id, '" + managedBy + "')]")).Click();
                            DriverContext.Driver.FindElement(By.XPath("/html/body/div[2]/div/div[4]/div/div/form/div/div/div/button[2]")).Click();
                            DriverContext.Driver.SwitchTo().Window(DriverContext.Driver.WindowHandles.First());
                        }
                        catch (Exception)
                        {
                            return(ErrorDescriptions.ErrorManagerNotAdded);
                        }
                    }

                    if (!string.IsNullOrEmpty(businessPhone))
                    {
                        txtGeneralProfileBusinessPhoneElem.Clear();
                        txtGeneralProfileBusinessPhoneElem.SendKeys(businessPhone);
                    }

                    if (!string.IsNullOrEmpty(fax))
                    {
                        txtGeneralProfileFaxElem.Clear();
                        txtGeneralProfileFaxElem.SendKeys(fax);
                    }

                    if (!string.IsNullOrEmpty(homePhone))
                    {
                        txtGeneralProfileHomePhoneElem.Clear();
                        txtGeneralProfileHomePhoneElem.SendKeys(homePhone);
                    }

                    if (!string.IsNullOrEmpty(mobilePhone))
                    {
                        txtGeneralProfileMobilePhoneElem.Clear();
                        txtGeneralProfileMobilePhoneElem.SendKeys(mobilePhone);
                    }

                    if (!string.IsNullOrEmpty(pager))
                    {
                        txtGeneralProfilePagerElem.Clear();
                        txtGeneralProfilePagerElem.SendKeys(pager);
                    }

                    if (!string.IsNullOrEmpty(notes))
                    {
                        txtGeneralProfileNotesElem.Clear();
                        txtGeneralProfileNotesElem.SendKeys(notes);
                    }
                }

                Thread.Sleep(2000);
                btnCreateMailboxElem.Click();
                //PageRefresh(DriverContext.Driver);

                return(GetPrompt(headerProgressElem, headerProgressElemBy, MessageContainer.DialogeContainer));
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }