public void RequestDigiExisting(string searchtext) { SearchMaterial(searchtext); List <NgWebElement> MaterialsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSearch.displayedCollection"))); if (MaterialsSearched.Count > 0) { Console.WriteLine("RequestDigiExisting Material. Materials present for the Searched text"); foreach (IWebElement MaterialSearched in MaterialsSearched) { ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", MaterialSearched); Driver.HighlightElement(MaterialSearched); IWebElement RequestDigiMaterialButton = MaterialSearched.FindElement(MaterialRequestDigi_locator); if (RequestDigiMaterialButton.Displayed) { IWebElement MaterialTitle = MaterialSearched.FindElement(MaterialTitle_locator); Console.WriteLine("RequestDigiExisting Material Button found for : " + MaterialTitle.Text); Klick.On(RequestDigiMaterialButton); Console.WriteLine("RequestDigiExisting Material Successful"); break; } } } else { Console.WriteLine("RequestDigiExisting Material. No Materials present for the Searched text"); } }
public void SearchMaterial(string searchtext) { WaitFind.FindElem(MaterialNameSearchTextField, 10).Clear(); Klick.On(MaterialNameSearchTextField); Thread.Sleep(KortextGlobals.s); MaterialNameSearchTextField.SendKeys(searchtext); Thread.Sleep(KortextGlobals.s); Klick.On(MaterialNameSearchButton); Thread.Sleep(KortextGlobals.l); List <NgWebElement> MaterialsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSearch.displayedCollection"))); //IList<IWebElement> MaterialsSearchResults = Driver.Instance.FindElements(MaterialSearchResults_locator); if (MaterialsSearched.Count > 0) { Console.WriteLine("Materials present for the Searched text"); /* * foreach(IWebElement MaterialSearched in MaterialsSearched) * { * ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", MaterialSearched); * IWebElement MaterialTitle = MaterialSearched.FindElement(MaterialTitle_locator); * Driver.HighlightElement(MaterialTitle); * Console.WriteLine("Material Title: " + MaterialTitle.Text); * } */ } else { Console.WriteLine("No Materials present for the Searched text"); } }
private string SearchAndReturnNewNoticeName(string username) { //search for TestUser and increment suffix until you find one that hasn't been created yet. //Return that user name to be added. usernameappend = 1; for (int i = 0; i < i + 1; i++) { int found_flag = 0; UserNameText = username + usernameappend; Thread.Sleep(KortextGlobals.s); IList <IWebElement> SearchNoticeField = Driver.Instance.FindElements(SearchField_locator); if (SearchNoticeField.Count > 0) { WaitFind.FindElem(SearchNoticeField[1], 10).Clear(); Klick.On(SearchNoticeField[1]); Thread.Sleep(KortextGlobals.s); SearchNoticeField[1].SendKeys(UserNameText); Thread.Sleep(KortextGlobals.s); try { List <NgWebElement> NoticesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSysMess.displayedCollection"))); if (NoticesSearched.Count > 0) { foreach (IWebElement NoticeSearched in NoticesSearched) { Driver.HighlightElement(NoticeSearched); IWebElement NoticeName = NoticeSearched.FindElement(NoticeName_locator); if (NoticeName.Text == UserNameText) { found_flag = 1; usernameappend = usernameappend + 1; break; } } if (found_flag == 0) { Console.WriteLine("Notice Name found." + UserNameText); return(UserNameText); } } else { Console.WriteLine("Notice Name found." + UserNameText); return(UserNameText); } } catch (Exception e) { Console.WriteLine("Search -" + UserNameText + " Notice Not Found; Using this Notice Name " + e.Message); return(UserNameText); } } else { Console.WriteLine("Could not find the Search Field in SearchName function."); } } return(UserNameText); }
public void Do_Logout() { Thread.Sleep(KortextGlobals.s); // Pages.PearlRedMenuPage.ClickOnRebusLabelBtn(); Pages.PearlRedMenuPage.ClickOnMainMenuBtn(); WaitFind.FindElem(LogOut, 20); Klick.On(LogOut); }
public void ClickOnBrowseBtn() { // var browseButton = TestBase.driver.FindElement(By.Id("navbar-browse")); // Instance.FindElement(By.Id("wp-submit")); // browseButton.Click(); WaitFind.FindElem(browse_icon, 20); Klick.On(browse_icon); }
public void ViewNotice(string searchtext) { Driver.Instance.Navigate().Refresh(); Thread.Sleep(KortextGlobals.l); IList <IWebElement> SearchNoticeField = Driver.Instance.FindElements(SearchField_locator); if (SearchNoticeField.Count > 0) { WaitFind.FindElem(SearchNoticeField[1], 10).Clear(); Klick.On(SearchNoticeField[1]); Thread.Sleep(KortextGlobals.s); SearchNoticeField[1].SendKeys(searchtext); Thread.Sleep(KortextGlobals.s); List <NgWebElement> NoticesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSysMess.displayedCollection"))); if (NoticesSearched.Count > 0) { foreach (IWebElement NoticeSearched in NoticesSearched) { IWebElement NoticeNameField = NoticeSearched.FindElement(NoticeName_locator); if (NoticeNameField.Text == searchtext) { IWebElement NoticeViewButton = NoticeSearched.FindElement(ViewNotice_locator); Klick.On(NoticeViewButton); if (ViewNoticeHeader.Displayed) { Console.WriteLine("Viewing Notice Successful." + searchtext); Klick.On(NoticeCancelButton); break; } else { Console.WriteLine("Error while Viewing Notice." + searchtext); Driver.Instance.Navigate().Refresh(); Thread.Sleep(KortextGlobals.l); break; } } } } else { Console.WriteLine(searchtext + " Notice not found to be Viewed"); } } else { Console.WriteLine("Could not find the Search Field in View Notice function."); } }
public void ViewListsUsed(string searchtext) { SearchMaterial(searchtext); List <NgWebElement> MaterialsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSearch.displayedCollection"))); if (MaterialsSearched.Count > 0) { Console.WriteLine("View Lists using Material. Materials present for the Searched text"); foreach (IWebElement MaterialSearched in MaterialsSearched) { ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", MaterialSearched); Driver.HighlightElement(MaterialSearched); IWebElement ListsMaterialButton = MaterialSearched.FindElement(MaterialLists_locator); if (ListsMaterialButton.Displayed) { IWebElement MaterialTitle = MaterialSearched.FindElement(MaterialTitle_locator); Console.WriteLine("View Lists using Material Button found for : " + MaterialTitle.Text); Klick.On(ListsMaterialButton); Thread.Sleep(KortextGlobals.s); IWebElement ListsPageSubTitle = Driver.Instance.FindElement(locator); if (ListsPageSubTitle.Text == "view_list Lists") { List <NgWebElement> ListsUsed = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminLists.ListsService.displayedCollection"))); if (ListsUsed.Count > 0) { Thread.Sleep(KortextGlobals.s); Console.WriteLine("View Lists using Material Successful"); Driver.Instance.Navigate().Back(); break; } else { Console.WriteLine("No List using the Material. Moving to the next Material to check"); } } else { Console.WriteLine("Landed to an incorrect page." + ListsPageSubTitle.Text); Driver.Instance.Navigate().Back(); break; } } } } else { Console.WriteLine("View Lists using Material. No Materials present for the Searched text"); } }
//compares the first list in the search results to the page that comes up when you click it. public bool TraveltoFirstResult() { if (SearchResultString.Text != "Displaying 0 of 0 results found") { WaitFind.FindElem(SearchResultTableFirst, 10); var liststring = SearchResultTableFirst.Text; Console.WriteLine("String is: " + liststring); Klick.On(SearchResultTableFirst); Thread.Sleep(KortextGlobals.ll); Console.WriteLine("Title is: " + listtitle.Text); //compare the string return(listtitle.Text.Contains(liststring)); } return(false); }
public void UpdateTag(string oldtagname, string newtagname) { WaitFind.FindElem(FilterTagTextField, 10).Clear(); Klick.On(FilterTagTextField); Thread.Sleep(KortextGlobals.s); FilterTagTextField.SendKeys(oldtagname); Thread.Sleep(KortextGlobals.s); List <NgWebElement> TagsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminTags.displayedCollection"))); if (TagsSearched.Count > 0) { foreach (IWebElement TagSearched in TagsSearched) { IWebElement TagTitle = TagSearched.FindElement(TagTitle_locator); if (TagTitle.Text == oldtagname) { Klick.On(TagTitle); WaitFind.FindElem(TagUpdateTextField, 10).Clear(); Klick.On(TagUpdateTextField); Thread.Sleep(KortextGlobals.s); TagUpdateTextField.SendKeys(newtagname); Klick.On(TagUpdateSubmit); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); if (statusreturntext == "Tag updated") { Console.WriteLine("Tag Update Successful from " + oldtagname + " to " + newtagname); FilterTags(oldtagname); FilterTags(newtagname); } else { Console.WriteLine("Error while updating tag from " + oldtagname + " to " + newtagname + "." + statusreturntext); FilterTags(oldtagname); FilterTags(newtagname); } break; } } } else { Console.WriteLine(oldtagname + " Tag not found to be updated"); } }
public void DeleteTags(string searchtext) { WaitFind.FindElem(FilterTagTextField, 10).Clear(); Klick.On(FilterTagTextField); Thread.Sleep(KortextGlobals.s); FilterTagTextField.SendKeys(searchtext); Thread.Sleep(KortextGlobals.s); List <NgWebElement> TagsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminTags.displayedCollection"))); if (TagsSearched.Count > 0) { foreach (IWebElement TagSearched in TagsSearched) { IWebElement TagTitle = TagSearched.FindElement(TagTitle_locator); if (TagTitle.Text == searchtext) { try { IWebElement TagFindList = TagSearched.FindElement(TagFindPage_locator); } catch { IWebElement TagDeleteButton = TagSearched.FindElement(TagDelete_locator); Klick.On(TagDeleteButton); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); if (statusreturntext != "Tag deleted") { Console.WriteLine("Error while Deleting Tag." + statusreturntext); } else { Console.WriteLine("Deleting Tag Successful"); } break; } } } } else { Console.WriteLine(searchtext + " Tag not found to be deleted"); } Console.WriteLine("Searching Tag after Deleting"); FilterTags(searchtext); }
public void SearchNotices(string searchtext) { int i = 0; Driver.Instance.Navigate().Refresh(); Thread.Sleep(KortextGlobals.l); IList <IWebElement> SearchNoticeField = Driver.Instance.FindElements(SearchField_locator); if (SearchNoticeField.Count > 0) { WaitFind.FindElem(SearchNoticeField[1], 10).Clear(); Klick.On(SearchNoticeField[1]); Thread.Sleep(KortextGlobals.s); SearchNoticeField[1].SendKeys(searchtext); Thread.Sleep(KortextGlobals.s); List <NgWebElement> NoticesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSysMess.displayedCollection"))); if (NoticesSearched.Count > 0) { foreach (IWebElement NoticeSearched in NoticesSearched) { IWebElement NoticeName = NoticeSearched.FindElement(NoticeName_locator); if (NoticeName.Text == searchtext) { Console.WriteLine(searchtext + " Notice found"); i = 1; break; } } if (i == 0) { Console.WriteLine(searchtext + " Notice not found"); } } else { Console.WriteLine(searchtext + " Notice not found"); } } else { Console.WriteLine("Could not find the Search Field in Search function."); } }
public void AddNewNotice(string noticetype, string searchtext) { Thread.Sleep(KortextGlobals.s); Klick.On(CreateNoticeButton); Thread.Sleep(KortextGlobals.s); if (noticetype == "Alert") { new SelectElement(NoticeTypeList).SelectByIndex(1); } else if (noticetype == "News") { new SelectElement(NoticeTypeList).SelectByIndex(2); } else { Console.WriteLine("Incorrect Notice Type Passed. Selecting NEWS to continue."); new SelectElement(NoticeTypeList).SelectByIndex(2); } WaitFind.FindElem(NoticeSubjectTextField, 10).Clear(); Klick.On(NoticeSubjectTextField); Thread.Sleep(KortextGlobals.s); NoticeSubjectTextField.SendKeys(searchtext); Thread.Sleep(KortextGlobals.s); WaitFind.FindElem(NoticeBodyTextField, 10).Clear(); Klick.On(NoticeBodyTextField); Thread.Sleep(KortextGlobals.s); NoticeBodyTextField.SendKeys("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()?<>,.:;"); Thread.Sleep(KortextGlobals.s); Klick.On(NoticeSaveButton); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); if (statusreturntext != "Message added") { Console.WriteLine("Error while Creating New Notice." + statusreturntext); } else { Console.WriteLine("Creating Notice Successful"); } Thread.Sleep(KortextGlobals.s); Console.WriteLine("Searching Notices after Creation."); SearchNotices(searchtext); }
public bool IsLoggedOut() { try { var wait = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(40)); var myElement = wait.Until(x => x.FindElement(By.CssSelector("div.navicon-button"))); Klick.On(myElement); Thread.Sleep(KortextGlobals.s); // var loginElement = wait.Until(x => x.FindElement(By.Id("logout"))); return(Pages.LandingPage.LoginButtonIsDisplayed()); } catch (Exception e) { Console.WriteLine("Error logging out ", e.Message); return(false); } }
public void EditGlobalTags(string searchtext) { SearchMaterial(searchtext); List <NgWebElement> MaterialsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSearch.displayedCollection"))); if (MaterialsSearched.Count > 0) { Console.WriteLine("Edit Global Tags Material. Materials present for the Searched text"); foreach (IWebElement MaterialSearched in MaterialsSearched) { ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", MaterialSearched); Driver.HighlightElement(MaterialSearched); IWebElement TagsMaterialButton = MaterialSearched.FindElement(MaterialTags_locator); if (TagsMaterialButton.Displayed) { IWebElement MaterialTitle = MaterialSearched.FindElement(MaterialTitle_locator); Console.WriteLine("Edit Global Tags Material Button found for : " + MaterialTitle.Text); Klick.On(TagsMaterialButton); Thread.Sleep(KortextGlobals.s); WaitFind.FindElem(AddTagTextField, 10); AddTagTextField.SendKeys("GlobalTag"); AddTagTextField.SendKeys(Keys.Tab); Thread.Sleep(KortextGlobals.s); Klick.On(TagItemsButton); Thread.Sleep(KortextGlobals.s); List <NgWebElement> TagSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("tag in globalTagsCtrl.item.tags_global track by tag.id"))); if (TagSearched.Count == 1) { Console.WriteLine("Edit Global Tags Material Successful"); break; } else { Console.WriteLine("Edit Global Tags Material Not Successful." + TagSearched.Count); break; } } } } else { Console.WriteLine("Edit Global Tags Material. No Materials present for the Searched text"); } }
public void DeleteRole(string searchtext) { Driver.Instance.Navigate().Refresh(); Thread.Sleep(KortextGlobals.l); List <NgWebElement> UserTypesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("usertype in usertypes.US.allUsertypes track by usertype.id"))); if (UserTypesSearched.Count > 0) { foreach (IWebElement UserTypeSearched in UserTypesSearched) { Driver.HighlightElement(UserTypeSearched); IWebElement UserTypeTitle = UserTypeSearched.FindElement(TitleUserTypeName_locator); if (UserTypeTitle.Text == (searchtext + " expand_more")) { Klick.On(UserTypeTitle); Thread.Sleep(KortextGlobals.s); ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", UserTypeTitle); Thread.Sleep(KortextGlobals.s); IWebElement RoleDeleteButton = UserTypeSearched.FindElement(Delete_UserType_locator); Klick.On(RoleDeleteButton); Thread.Sleep(KortextGlobals.s); Klick.On(DeleteConfirmButton); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); if (statusreturntext != "User type deleted") { Console.WriteLine("Error while Deleting User Type Role." + statusreturntext); } else { Console.WriteLine("Deleting User Type Role Successful"); } break; } } } else { Console.WriteLine(searchtext + " User Type Role not found to be deleted"); } Console.WriteLine("Searching User Type after Deleting"); SearchRoles(searchtext); }
public bool IsLoggedIn() { //Check for log out button try { var wait = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(20)); var myElement = wait.Until(x => x.FindElement(By.Id("navicon-container"))); Klick.On(myElement); // Thread.Sleep(KortextGlobals.s); var logoutElement = wait.Until(x => x.FindElement(By.Id("logout"))); var MenuBack = wait.Until(x => x.FindElement(By.CssSelector("div.circle.open"))); Klick.On(MenuBack); return(true); } catch (Exception e) { Console.WriteLine("Error logging in ", e.Message); return(false); } }
public void AddNewTag(string searchtext) { WaitFind.FindElem(TagNameSearchTextField, 10).Clear(); Klick.On(TagNameSearchTextField); Thread.Sleep(KortextGlobals.s); TagNameSearchTextField.SendKeys(searchtext); Thread.Sleep(KortextGlobals.s); Klick.On(TagNameSearchButton); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); if (statusreturntext != "Tag created") { Console.WriteLine("Error while Creating a New Global Tag." + statusreturntext); } else { Console.WriteLine("Creating a New Global Tag Successful"); } Thread.Sleep(KortextGlobals.s); Console.WriteLine("Searching Tag after Creation"); FilterTags(searchtext); }
public bool PurgeAllLocalStorage() { ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("window.scrollTo(0, document.body.scrollHeight)"); Thread.Sleep(KortextGlobals.s); IList <IWebElement> LinksinAboutPage = Driver.Instance.FindElements(PurgeName_locator); if (LinksinAboutPage.Count > 0) { foreach (IWebElement LinkinAboutPage in LinksinAboutPage) { if (LinkinAboutPage.Text == "Purge Local Storage") { Klick.On(LinkinAboutPage); Thread.Sleep(KortextGlobals.s); WaitFind.FindElem(PurgeButton, 10); Klick.On(PurgeButton); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); if (statusreturntext == "Local storage purged") { Console.WriteLine("Purging All Local Storage Successful."); return(true); } else { Console.WriteLine("Error while Purging Local Storage." + statusreturntext); return(false); } } } } else { Console.WriteLine("Error Loading About Page."); return(false); } Console.WriteLine("Could Not find Purge link in About Page."); return(false); }
public void EditMaterial(string searchtext) { SearchMaterial(searchtext); List <NgWebElement> MaterialsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSearch.displayedCollection"))); if (MaterialsSearched.Count > 0) { Console.WriteLine("Edit Material. Materials present for the Searched text"); foreach (IWebElement MaterialSearched in MaterialsSearched) { ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", MaterialSearched); Driver.HighlightElement(MaterialSearched); IWebElement EditMaterialButton = MaterialSearched.FindElement(MaterialEdit_locator); if (EditMaterialButton.Displayed) { IWebElement MaterialTitle = MaterialSearched.FindElement(MaterialTitle_locator); Console.WriteLine("Edit Material Button found for : " + MaterialTitle.Text); Klick.On(EditMaterialButton); Pages.PearlEditBuffer.EditCitation(); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); if (statusreturntext != "Material changes saved") { Console.WriteLine("Error while Editing Material." + statusreturntext); break; } else { Console.WriteLine("Editing Material Successful"); break; } } } } else { Console.WriteLine("Edit Material. No Materials present for the Searched text"); } }
public void NavigatetoAcquisitionSettings() { Thread.Sleep(KortextGlobals.s); List <NgWebElement> AcquisitionsTabs = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("tab in acqController.formTabs"))); if (AcquisitionsTabs.Count > 0) { foreach (IWebElement AcquisitionsTab in AcquisitionsTabs) { Driver.HighlightElement(AcquisitionsTab); IWebElement TabName = AcquisitionsTab.FindElement(AcquisitionsTabName_locator); if (TabName.Text == "Settings") { Klick.On(TabName); Thread.Sleep(KortextGlobals.s); } } } else { Console.WriteLine("Error loading Acquisitions Page"); } }
public void FilterTags(string searchtext) { int i = 0; Driver.Instance.Navigate().Refresh(); Thread.Sleep(KortextGlobals.ll); WaitFind.FindElem(FilterTagTextField, 10).Clear(); Klick.On(FilterTagTextField); Thread.Sleep(KortextGlobals.s); FilterTagTextField.SendKeys(searchtext); Thread.Sleep(KortextGlobals.s); List <NgWebElement> TagsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminTags.displayedCollection"))); if (TagsSearched.Count > 0) { foreach (IWebElement TagSearched in TagsSearched) { IWebElement TagTitle = TagSearched.FindElement(TagTitle_locator); if (TagTitle.Text == searchtext) { Console.WriteLine(searchtext + " Tag found"); i = 1; break; } } if (i == 0) { Console.WriteLine(searchtext + " Tag not found"); } } else { Console.WriteLine(searchtext + " Tag not found"); } }
public void UpdateRole(string rolenm, string rolefield, string newtext) { Driver.Instance.Navigate().Refresh(); Thread.Sleep(KortextGlobals.l); List <NgWebElement> UserTypesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("usertype in usertypes.US.allUsertypes track by usertype.id"))); if (UserTypesSearched.Count > 0) { foreach (IWebElement UserTypeSearched in UserTypesSearched) { Driver.HighlightElement(UserTypeSearched); IWebElement UserTypeTitle = UserTypeSearched.FindElement(TitleUserTypeName_locator); if (UserTypeTitle.Text == (rolenm + " expand_more")) { Klick.On(UserTypeTitle); Thread.Sleep(KortextGlobals.s); ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", UserTypeTitle); Thread.Sleep(KortextGlobals.s); if (rolefield == "Name") { IWebElement UserTypeName = UserTypeSearched.FindElement(UserTypeName_locator); Klick.On(UserTypeName); Thread.Sleep(KortextGlobals.s); WaitFind.FindElem(TypeNameDescTextField, 10).Clear(); Klick.On(TypeNameDescTextField); Thread.Sleep(KortextGlobals.s); TypeNameDescTextField.SendKeys(newtext); Thread.Sleep(KortextGlobals.s); Klick.On(NameDescSubmitButton); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); if (statusreturntext != "User type updated") { Console.WriteLine("Error while Updating User Role Name." + statusreturntext); } else { Console.WriteLine("User Role Name Update Successful"); } } else if (rolefield == "Description") { IWebElement UserTypeDesc = UserTypeSearched.FindElement(UserTypeDesc_locator); Klick.On(UserTypeDesc); Thread.Sleep(KortextGlobals.s); WaitFind.FindElem(TypeNameDescTextField, 10).Clear(); Klick.On(TypeNameDescTextField); Thread.Sleep(KortextGlobals.s); TypeNameDescTextField.SendKeys(newtext); Thread.Sleep(KortextGlobals.s); Klick.On(NameDescSubmitButton); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); if (statusreturntext != "User type updated") { Console.WriteLine("Error while Updating User Role Description." + statusreturntext); } else { Console.WriteLine("User Role Description Update Successful"); } } else { Console.WriteLine("Incorrect Role Field passed to the function."); } break; } } } else { Console.WriteLine(rolenm + " Role not found to be updated"); } }
public void ClickOnMainMenuBtn() { WaitFind.FindElem(main_menu_btn, 20); Klick.On(main_menu_btn); }
public void ClickOnRebusLabelBtn() { WaitFind.FindElem(rebuslabel_btn, 20); Klick.On(rebuslabel_btn); }
public void ClickOnFooter_rebuslistLink() { Pages.PearlRedMenuPage.ClickOnMainMenuBtn(); WaitFind.FindElem(rebuslistLink, 20); Klick.On(rebuslistLink); }
public void ClickOnFooter_PTFSEuropeLink() { Pages.PearlRedMenuPage.ClickOnMainMenuBtn(); WaitFind.FindElem(ptfsLink, 20); Klick.On(ptfsLink); }
public void ClickOnFooter_ContactUsLink() { Pages.PearlRedMenuPage.ClickOnMainMenuBtn(); WaitFind.FindElem(contactusLink, 20); Klick.On(contactusLink); }
public void AddResp(string searchtext) { Driver.Instance.Navigate().Refresh(); Thread.Sleep(KortextGlobals.l); List <NgWebElement> UserTypesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("usertype in usertypes.US.allUsertypes track by usertype.id"))); if (UserTypesSearched.Count > 0) { foreach (IWebElement UserTypeSearched in UserTypesSearched) { Driver.HighlightElement(UserTypeSearched); IWebElement UserTypeTitle = UserTypeSearched.FindElement(TitleUserTypeName_locator); if (UserTypeTitle.Text == (UserNameText + " expand_more")) { Klick.On(UserTypeTitle); Thread.Sleep(KortextGlobals.s); ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", UserTypeTitle); Thread.Sleep(KortextGlobals.l); IList <IWebElement> AvailableResp = Driver.Instance.FindElements(AvailableResp_locator); if (AvailableResp.Count > 0) { List <NgWebElement> IndividualResponsibilities = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("thisResp in usertypeController.unassignedResponsibilities() | orderBy: 'name' track by thisResp.id"))); if (IndividualResponsibilities.Count > 0) { int AvailableRespCount = IndividualResponsibilities.Count; foreach (IWebElement IndividualResp in IndividualResponsibilities) { Driver.HighlightElement(IndividualResp); IWebElement AddRespName = IndividualResp.FindElement(By.ClassName("ng-binding")); //Console.WriteLine("AddRespName.Text = " + AddRespName.Text); string ResponsibilityNm = AddRespName.Text; IWebElement AddResponsibility = IndividualResp.FindElement(Add_Resp_locator); Klick.On(AddResponsibility); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); // checkingstring = string.Concat(); //Console.WriteLine("checkingstring = " + checkingstring); if (statusreturntext != string.Concat(ResponsibilityNm, " assigned to ", searchtext)) { Console.WriteLine("Error while Adding Responsibilities." + ResponsibilityNm + "." + statusreturntext); } else { Console.WriteLine("Adding Responsibilities Successful." + ResponsibilityNm); } List <NgWebElement> IndividualResponsibilitiesAfter = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("thisResp in usertypeController.unassignedResponsibilities() | orderBy: 'name' track by thisResp.id"))); int AvailableRespCountAfter = IndividualResponsibilitiesAfter.Count; if (AvailableRespCount == (AvailableRespCountAfter + 1)) { Console.WriteLine("Adding Responsibilities Completed"); } else { Console.WriteLine("Error while Adding Responsibilities"); } break; } } else { Console.WriteLine("No Available Responsibilties present for Addition"); } } else { Console.WriteLine("Section for Available Responsibilities not found"); } } } } else { Console.WriteLine(searchtext + " User Type Role not found to Assign Responsibilities"); } }
public void DeletePriv(string searchtext) { Driver.Instance.Navigate().Refresh(); Thread.Sleep(KortextGlobals.l); List <NgWebElement> UserTypesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("usertype in usertypes.US.allUsertypes track by usertype.id"))); if (UserTypesSearched.Count > 0) { foreach (IWebElement UserTypeSearched in UserTypesSearched) { Driver.HighlightElement(UserTypeSearched); IWebElement UserTypeTitle = UserTypeSearched.FindElement(TitleUserTypeName_locator); if (UserTypeTitle.Text == (UserNameText + " expand_more")) { Klick.On(UserTypeTitle); Thread.Sleep(KortextGlobals.s); ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", UserTypeTitle); Thread.Sleep(KortextGlobals.l); IList <IWebElement> AssignedPriv = Driver.Instance.FindElements(AssignedPriv_locator); if (AssignedPriv.Count > 0) { List <NgWebElement> IndividualPriviledges = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("thisPriv in usertypeController.usertype.privileges | orderBy: 'name' track by thisPriv.name"))); if (IndividualPriviledges.Count > 0) { int AvailablePrivCount = IndividualPriviledges.Count; foreach (IWebElement IndividualPriv in IndividualPriviledges) { Driver.HighlightElement(IndividualPriv); IWebElement DeletePrivName = IndividualPriv.FindElement(By.ClassName("ng-binding")); string PriviledgeNm = DeletePrivName.Text; IWebElement DeletePriviledge = IndividualPriv.FindElement(Delete_Priv_locator); Klick.On(DeletePriviledge); statusreturntext = Pages.PearlEditBuffer.StatusMessage(); if (statusreturntext != (PriviledgeNm + " removed from " + searchtext)) { Console.WriteLine("Error while Deleting Priviledges." + PriviledgeNm + "." + statusreturntext); } else { Console.WriteLine("Deleting Priviledges Successful." + PriviledgeNm); } List <NgWebElement> IndividualPriviledgesAfter = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("thisPriv in usertypeController.usertype.privileges | orderBy: 'name' track by thisPriv.name"))); int AvailablePrivCountAfter = IndividualPriviledgesAfter.Count; if (AvailablePrivCount == (AvailablePrivCountAfter + 1)) { Console.WriteLine("Deleting Priviledges Completed"); } else { Console.WriteLine("Error while Deleting Priviledges"); } break; } } else { Console.WriteLine("No Assigned Priviledges present for Deletion"); } } else { Console.WriteLine("Section for Available Priviledges not found"); } } } } else { Console.WriteLine(searchtext + " User Type Role not found to Assign Priviledges"); } }
public void ClickOnFooter_BlackboardLink() { Pages.PearlRedMenuPage.ClickOnMainMenuBtn(); WaitFind.FindElem(blackboardLink, 20); Klick.On(blackboardLink); }