Exemplo n.º 1
0
        public void GeAlinkFromFrame()
        {
            IEOperateCore         ieCore   = new IEOperateCore("http://psgis.chinasofti.com/oa/SignOnServlet");
            HTMLInputElementClass userName = ieCore.GetElementByTagName <HTMLInputElementClass>("input").ToList().Find(item => item.name.Equals("userName"));
            HTMLInputElementClass passWord = ieCore.GetElementByTagName <HTMLInputElementClass>("input").ToList().Find(item => item.name.Equals("password"));
            HTMLImgClass          imgLogin = ieCore.GetElementByTagName <HTMLImgClass>("img").ToList().Find(item => item.name.Equals("login_r3_c3"));

            userName.value = string.Empty;
            passWord.value = string.Empty;
            userName.value = "E100086376";
            passWord.value = "Qa20080607";
            imgLogin.click();
            Thread.Sleep(3500);
            ieCore = new IEOperateCore("http://psgis.chinasofti.com/oa/portal");
            HTMLDivElementClass btnPMS = ieCore.GetElementByTagName <HTMLDivElementClass>("div").ToList().Find(item => item.className.Equals("channel app_PMS系统"));

            Thread.Sleep(4000);
            btnPMS.click();
            Thread.Sleep(5000);

            ieCore = new IEOperateCore("http://psgpms.chinasofti.com/main.jsp");


            HTMLFrameElementClass midIframe = ieCore.GetInputElementByID <HTMLFrameElementClass>("ManagerLeftFrame");
        }
Exemplo n.º 2
0
        public static string Execute(HtmlElement linkToClick)
        {
            try
            {
                //HTMLAnchorElementClass linkElement = (HTMLAnchorElementClass) linkToClick.DomElement;
                //linkElement.click();
                HTMLImgClass linkElement = (HTMLImgClass)linkToClick.DomElement;
                linkElement.click();
            }
            catch (Exception ex)
            {
                return(String.Format("Unable to click link: {0}", ex.Message));
            }

            return("Link was clicked, new page opened...");
        }