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); } }
public string SetArchive() { try { btnAddUserArchiveElem.Click(); SeleniumHelperMethods.WaitExpectedConditionsClickable(DriverContext.Driver, btnCreateArchiveMailbox); DriverContext.Driver.FindElement(By.XPath("//*[@id='ArchiveQuotaValue']/label/input")).Click(); btnCreateArchiveMailbox.Click(); return(GetPrompt(headerProgressElem, headerProgressElemBy, MessageContainer.DialogeContainer)); } catch (Exception ex) { return(ex.Message); } }
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()); } }
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); } }
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()); } }
public void CloseDialogueBox() { SeleniumHelperMethods.WaitExpectedConditionsClickable(DriverContext.Driver, btnCloseDialogueBox); Thread.Sleep(2000); btnCloseDialogueBox.Click(); }
//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); } }