Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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();
        }
Пример #4
0
 public static void NavigateToSubject(String subject)
 {
     SeleniumGetMethods.Parent(SeleniumGetMethods.Parent(SeleniumGetMethods.GetWebElementInnerHTML(subject))).Click();
 }
Пример #5
0
        public static void NavigateToCategory(String category)
        {
            var title = SeleniumGetMethods.Parent(SeleniumGetMethods.GetParentNode(SeleniumGetMethods.GetWebElementInnerHTML(category)));

            SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetChild(2, title)).Click();
        }