Пример #1
0
        public void ClickAnchorWithValue(string anchorValue)
        {
            HTMLAnchorElement anchor = (HTMLAnchorElement)GetElementByValue("A", anchorValue);

            anchor.click();
            WaitForComplete();
        }
Пример #2
0
        public void ClickAnchor(string anchorId)
        {
            isDocumentComplete = false;
            HTMLAnchorElement input = GetAnchorElement(anchorId);

            input.click();
            WaitForComplete();
        }
Пример #3
0
        //
        private void button5_Click(object sender, EventArgs e)
        {
            HTMLAnchorElement musicAnchor = (HTMLAnchorElement)w.GetElementByTAV("a", "href", "/music");

            w.BeginPageLoading();
            musicAnchor.click();
            w.WaitForComplete();
        }
Пример #4
0
        public void ClickAnchorWithParent(string parentControlId, string anchorId)
        {
            isDocumentComplete = false;
            anchorId           = parentControlId + anchorId;
            HTMLAnchorElement input = GetAnchorElement(anchorId);

            input.click();
            WaitForComplete();
        }
Пример #5
0
        public static void ClickLogin(WebUtil w)
        {
            HTMLAnchorElement loginElement = (HTMLAnchorElement)w.GetElementByValue("a", "href", "/login");

            if (loginElement != null)
            {
                w.BeginPageLoading();
                loginElement.click();
                w.WaitForComplete(); //block main thread until loaded event is fired
            }
        }
    public static void eleClick(this WebBrowser wb, string tag, string data)
    {
        HtmlElementCollection eleCollection = wb.Document.GetElementsByTagName(tag);

        foreach (HtmlElement ele in eleCollection)
        {
            if (ele.InnerHtml.ToCString().ToLower() == data)
            {
                switch (tag)
                {
                case "a":
                    HTMLAnchorElement ancele = (HTMLAnchorElement)ele.DomElement;
                    ancele.click();
                    break;
                }
                break;
            }
        }
    }
    public static void eleClick(this WebBrowser wb, string id)
    {
        HtmlElement ele = wb.Document.All[id];

        if (ele.IsNotNull())
        {
            switch (ele.TagName.ToLower())
            {
            case "input":
                HTMLButtonElement btnele = (HTMLButtonElement)ele.DomElement;
                btnele.click();
                break;

            case "a":
                HTMLAnchorElement ancele = (HTMLAnchorElement)ele.DomElement;
                ancele.click();
                break;
            }
        }
    }
Пример #8
0
        public static void GoToProfile(WebUtil w)
        {
            HTMLUListElement  ullist = (HTMLUListElement)w.GetUList("ul", "class", "visible-menu");
            HTMLAnchorElement anchor = null;
            int i = 0;

            foreach (HTMLLIElement element in ullist.getElementsByTagName("li"))
            {
                if (i == 0)
                {
                    anchor = (HTMLAnchorElement)element.firstChild;
                    i     += 1;
                }
            }

            w.BeginPageLoading();
            if (anchor != null)
            {
                anchor.click();
            }
            w.WaitForComplete();
        }