示例#1
0
        public void click()
        {
            IntPtr hid = handleid("msn");

            //System.Threading.Thread.Sleep(2000);
            this.myHtmlDoc = this.cls.Get_HtmlDocumentToWindow(hid, "Name", "mstest_eses_1009");
            Maui.Core.WinControls.Button objExactControl = this.c2.Get_MauiButton(this.myHtmlDoc);
            if (objExactControl.IsEnabled)
            {
                objExactControl.Click();
                Thread.Sleep(2000);
            }

            try
            {
                this.myHtmlDoc = this.cls.Get_HtmlDocumentToWindow(hid, "AutomationId", "4019");
                Maui.Core.WinControls.TextBox objExactControl4 = this.c2.Get_text(this.myHtmlDoc);
            }
            catch (Exception ex)
            {
                this.myHtmlDoc = this.cls.Get_HtmlDocumentToWindow(hid, "AutomationId", "5001");
                Maui.Core.WinControls.Control objExactControl2 = this.c2.Get_MauiControl(this.myHtmlDoc);
                objExactControl2.Click();
                this.click();
            }
        }
        public void hello()
        {
            IntPtr hid12 = handleid("msn");

            this.myHtmlDoc10 = this.cls.Get_HtmlDocumentToWindow(hid12, "AutomationId", "4026");
            Maui.Core.WinControls.CheckBox objExactControl10 = this.c2.getbox(this.myHtmlDoc10);

            if (objExactControl10.Checked)
            {
                MessageBox.Show("checked");
            }

            else
            {
                MessageBox.Show("unchecked");
            }



            //System.Threading.Thread.Sleep(5000);
            IntPtr hid = handleid("msn");

            this.myHtmlDoc2 = this.cls.Get_HtmlDocumentToWindow(hid, "AutomationId", "4019");
            Maui.Core.WinControls.TextBox objExactControl2 = this.c2.Get_text(this.myHtmlDoc2);
            objExactControl2.Text = "password";

            //System.Threading.Thread.Sleep(5000);

            this.myHtmlDoc3 = this.cls.Get_HtmlDocumentToWindow(hid, "AutomationId", "4020");

            Maui.Core.WinControls.Control objExactControl3 = this.c2.Get_MauiControl(this.myHtmlDoc3);
            objExactControl3.Click();



            Thread.Sleep(1000);

            hell();



            System.Threading.Thread.Sleep(40000);

            IntPtr hid1 = handleid("msn");

            //this.myHtmlDoc4 = this.cls.Get_HtmlDocumentToWindow(hid1, "AutomationId", "2337");
            //Maui.Core.WinControls.Control objExactControl4 = this.c2.Get_MauiControl(this.myHtmlDoc4);
            //objExactControl4.Click();

            this.myHtmlDoc5 = this.cls.Get_HtmlDocumentToWindow(hid1, "AutomationId", "61536");
            Maui.Core.WinControls.Control objExactControl5 = this.c2.Get_MauiControl(this.myHtmlDoc5);
            objExactControl5.Click();

            this.myHtmlDoc5 = this.cls.Get_HtmlDocumentToWindow(hid1, "AutomationId", "1");
            Maui.Core.WinControls.Control objExactControl6 = this.c2.Get_MauiControl(this.myHtmlDoc5);
            objExactControl6.Click();
        }
        /// <summary>
        /// To get the ToolStripItems for the given window
        /// </summary>
        /// <returns>StringCollection of ToolStripItem names in the supplied window</returns>
        public static StringCollection GetToolStripItems(Maui.Core.Window fromWindow)
        {
            StringCollection strToostripItems = new StringCollection();
            ToolStrip        toolstrip        = new ToolStrip(fromWindow);

            for (int i = 0; i < toolstrip.ToolStripItems.Count; i++)
            {
                strToostripItems.Add(toolstrip.ToolStripItems[i].Text);
            }

            return(strToostripItems);
        }
示例#4
0
        public void hell()
        {
            IntPtr hid = handleid("msn");

            this.myHtmlDoc = this.cls.Get_HtmlDocumentToWindow(hid, "Name", "Main Toolbar");
            Maui.Core.WinControls.Toolbar objExactControl = this.c2.toolbar(this.myHtmlDoc);
            string abc = objExactControl.AccessibleObject.Children[0].Children[3].Description;

            if (abc.Contains("bing"))
            {
                MessageBox.Show("bing pass");
            }

            else
            {
                MessageBox.Show("Fail");
            }
        }
        public static Maui.Core.Window GetWindow(App application, string caption, bool throwWhenWindowNotFound)
        {
            Window window = null;

            try
            {
                window = new Maui.Core.Window(caption, StringMatchSyntax.ExactMatch, "WindowsForms10.Window.8.*", StringMatchSyntax.WildCard, application, 5000);
            }
            catch (Window.Exceptions.WindowNotFoundException ex)
            {
                window = null;

                if (throwWhenWindowNotFound)
                {
                    throw new WindowNotFoundException(String.Format("{0} Screen not Found", caption), ex);
                }
            }

            return(window);
        }
        /// <summary>
        /// To get the menu item heirarchy for the given window
        /// </summary>
        /// <returns>Dictionary of menu heirarchy in the supplied window</returns>
        public static Dictionary <string, StringCollection> GetMenuItems(Maui.Core.Window fromWindow)
        {
            Dictionary <string, StringCollection> menuDictionary = new Dictionary <string, StringCollection>();
            string           strRootMenu = string.Empty;
            StringCollection strMenuItems;

            Menu appMenu = new Menu(fromWindow);

            for (int i = 0; i < appMenu.MenuItems.Count; i++)
            {
                strRootMenu  = appMenu.MenuItems[i].Text;
                strMenuItems = new StringCollection();

                for (int j = 0; j < appMenu.MenuItems[i].MenuItems.Count; j++)
                {
                    strMenuItems.Add(appMenu.MenuItems[i].MenuItems[j].Text);
                }

                menuDictionary.Add(strRootMenu, strMenuItems);
            }
            return(menuDictionary);
        }