public static void DeleteComment(String comment) { var commentRootElem = SeleniumGetMethods.Parent(SeleniumGetMethods.GetWebElementInnerHTML(comment)); var childs = SeleniumGetMethods.GetChilds(commentRootElem); var editeButton = SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetFirstChild((IWebElement)childs[3])); var delete = SeleniumGetMethods.GetNextSibling(editeButton); delete.Click(); }
public static void GetRole(UserRole userRole) { const int SELECT_ROLE_INDEX_IN_DOM = 4; const int SAVE_BUTTON_INDEX_IN_DOM = 5; var tr = SeleniumGetMethods.Parent(SeleniumGetMethods.Parent(SeleniumGetMethods.GetWebElementInnerHTML(userRole.Username))); var select = SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetChild(SELECT_ROLE_INDEX_IN_DOM, tr)); SeleniumSetMethods.SelectDropDown(select, userRole.Role); Sincronize.Wait(2000); var save = SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetChild(SAVE_BUTTON_INDEX_IN_DOM, tr)); save.Click(); }
public static void EditeComment(String originalComment, String newComment, bool append) { var commentRootElem = SeleniumGetMethods.Parent(SeleniumGetMethods.GetWebElementInnerHTML(originalComment)); var childs = SeleniumGetMethods.GetChilds(commentRootElem); var editeButton = SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetFirstChild((IWebElement)childs[3])); editeButton.Click(); var textarea = SeleniumGetMethods.GetWebElementByName("ctl00$MainContent$AddMessageLoginView$EditMessageTB"); if (!append) { textarea.Clear(); } else { } textarea.SendKeys(newComment); var addCommentButton = SeleniumGetMethods.GetWebElementByAttribut("value", "Salveaza"); addCommentButton.Click(); }
public static void NavigateToSubject(String subject) { SeleniumGetMethods.Parent(SeleniumGetMethods.Parent(SeleniumGetMethods.GetWebElementInnerHTML(subject))).Click(); }
public static void NavigateToCategory(String category) { var title = SeleniumGetMethods.Parent(SeleniumGetMethods.GetParentNode(SeleniumGetMethods.GetWebElementInnerHTML(category))); SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetChild(2, title)).Click(); }