示例#1
0
        /// <summary>
        /// LoadRecipeAliasesWindow
        /// </summary>
        public void LoadRecipeAliasesWindow()
        {
            #region Variable Declarations
            //WinMenuBar uIApplicationMenuBar = this.UISmartViewRecipeManagWindow.UIApplicationMenuBar;
            WinMenuBar uIApplicationMenuBar = (WinMenuBar)this.UISmartViewRecipeManagWindow.GetChildren()[2];
            #endregion

            TextWriter tw = new StreamWriter("D:\\testapp.txt");
            for (int i = 0; i < this.UISmartViewRecipeManagWindow.GetChildren().Count; i++)
            {
                tw.WriteLine(this.UISmartViewRecipeManagWindow.GetChildren()[i].GetType().ToString());
                tw.WriteLine(this.UISmartViewRecipeManagWindow.GetChildren()[i].GetChildren().Count);
            }

            tw.WriteLine("=======================================" + uIApplicationMenuBar.GetChildren().Count);

            for (int i = 0; i < uIApplicationMenuBar.GetChildren().Count; i++)
            {
                tw.WriteLine("=======================================");
                tw.WriteLine(uIApplicationMenuBar.GetChildren()[i].GetType().ToString());
            }
            tw.Close();
            // Click 'Application' menu bar
            Thread.Sleep(10000);
            Mouse.Click(new Point(174, 38));
        }
        /// <summary>
        /// CreateStandardSingleViewArchitecture - Use 'CreateStandardSingleViewArchitectureParams' to pass parameters into this method.
        /// </summary>
        public void LoadNewArchitectureWindow()
        {
            #region Variable Declarations
            WinMenuBar  uIApplicationMenuBar = this.UISmartViewConfiguratiWindow.UIApplicationMenuBar;
            WinEdit     uIItemEdit           = this.UINewArchitectureWindow.UIItemWindow.UIItemEdit;
            WinGroup    uIItemGroup          = this.UINewArchitectureWindow.UIItemWindow1.UIItemGroup;
            WinTreeItem uIStationTreeItem    = this.UINewArchitectureWindow.UIItemWindow2.UIItemTree.UILineTreeItem.UIStationTreeItem;
            WinButton   uIOKButton           = this.UINewArchitectureWindow.UIOKWindow.UIOKButton;
            #endregion

            FocusConfigurationManager();
            // Click 'Application' menu bar
            Mouse.Click(new Point(33, 44));

            // Click 'Unknown Name' text box
            // Mouse.Click(uIItemEdit, new Point(37, 2));

            // Type 'automation' in 'Unknown Name' text box
            // uIItemEdit.Text = name;

            // Double-Click 'OK' button
            // Mouse.Click(uIOKButton, new Point(47, 13));

            //AssignCameraToView();
        }
示例#3
0
        /// <summary>
        /// CreateStandardSingleViewArchitecture - Use 'CreateStandardSingleViewArchitectureParams' to pass parameters into this method.
        /// </summary>
        public void CreateStandardSingleViewArchitecture(String name)
        {
            #region Variable Declarations
            WinMenuBar  uIApplicationMenuBar = this.UISmartViewConfiguratiWindow.UIApplicationMenuBar;
            WinEdit     uIItemEdit           = this.UINewArchitectureWindow.UIItemWindow.UIItemEdit;
            WinGroup    uIItemGroup          = this.UINewArchitectureWindow.UIItemWindow1.UIItemGroup;
            WinTreeItem uIStationTreeItem    = this.UINewArchitectureWindow.UIItemWindow2.UIItemTree.UILineTreeItem.UIStationTreeItem;
            WinButton   uIOKButton           = this.UINewArchitectureWindow.UIOKWindow.UIOKButton;
            #endregion

            FocusConfigurationManager();
            // Click 'Application' menu bar
            Mouse.Click(new Point(33, 44));

            // Click 'Unknown Name' text box
            Mouse.Click(uIItemEdit, new Point(37, 2));

            // Move 'Unknown Name' group from (38, 29) to 'Line' -> 'Station' tree item (14, 4)
            uIStationTreeItem.EnsureClickable(new Point(14, 4));
            Mouse.StartDragging(uIItemGroup, new Point(38, 29));
            Mouse.StopDragging(uIStationTreeItem, new Point(14, 4));

            // Type 'automation' in 'Unknown Name' text box
            uIItemEdit.Text = name;

            // Double-Click 'OK' button
            Mouse.Click(uIOKButton, new Point(47, 13));

            AssignCameraToView();
        }
示例#4
0
        /// <summary>
        /// AssignCameraTemplateToView
        /// </summary>
        public void AssignCameraTemplateToView(int noOfCameraTemplate)
        {
            #region Variable Declarations
            WinMenuBar  uIApplicationMenuBar = this.UISmartViewConfiguratiWindow.UIApplicationMenuBar;
            WinGroup    uIItemGroup          = this.UINewArchitectureWindow.UIItemWindow.UIItemGroup;
            WinTreeItem uIStationTreeItem    = this.UINewArchitectureWindow.UIItemWindow1.UIItemTree.UILineTreeItem.UIStationTreeItem;
            WinTreeItem uIView1TreeItem      = this.UINewArchitectureWindow.UIItemWindow1.UIItemTree.UILineTreeItem.UIStationTreeItem.UIView1TreeItem;
            #endregion


            // Click 'Application' menu bar
            Mouse.Click(uIApplicationMenuBar, new Point(34, 51));

            // Move 'Unknown Name' group from (26, 30) to 'Line' -> 'Station' tree item (23, 14)
            uIStationTreeItem.EnsureClickable(new Point(23, 14));
            Mouse.StartDragging(uIItemGroup, new Point(26, 30));
            Mouse.StopDragging(uIStationTreeItem, new Point(23, 14));

            // Move 'Unknown Name' group from (264, 23) to 'Line' -> 'Station' -> 'View 1' tree item (18, 5)
            uIView1TreeItem.EnsureClickable(new Point(18, 5));
            Mouse.StartDragging(uIItemGroup, new Point(264, 23));
            Mouse.StopDragging(uIView1TreeItem, new Point(18, 5));

            // Move 'Unknown Name' group from (267, 22) to 'Line' -> 'Station' -> 'View 1' tree item (9, 5)
            uIView1TreeItem.EnsureClickable(new Point(9, 5));
            Mouse.StartDragging(uIItemGroup, new Point(267, 22));
            Mouse.StopDragging(uIView1TreeItem, new Point(9, 5));

            // Move 'Unknown Name' group from (258, 23) to 'Line' -> 'Station' -> 'View 1' tree item (11, 14)
            uIView1TreeItem.EnsureClickable(new Point(11, 14));
            Mouse.StartDragging(uIItemGroup, new Point(258, 23));
            Mouse.StopDragging(uIView1TreeItem, new Point(11, 14));
        }
示例#5
0
        private static WinMenuBar GetWinMenuBar(string uiTitle, string uiType)
        {
            var htmlcontrolWin = new WinMenuBar(Window.Locate(uiTitle, uiType));
            var htmlControlWin = htmlcontrolWin;

            htmlControlWin.TechnologyName = TechnologyNameWin;
            return(htmlControlWin);
        }
示例#6
0
        /// <summary>
        /// ClickOpenButton
        /// </summary>
        public void ClickOpenButton()
        {
            #region Variable Declarations
            WinMenuBar uIApplicationMenuBar = this.UISmartViewRecipeManagWindow.UIApplicationMenuBar;
            #endregion

            // Click 'Application' menu bar
            Mouse.Click(uIApplicationMenuBar, new Point(64, 40));
        }
示例#7
0
        /// <summary>
        /// LoadReportAndExportSetupWindow
        /// </summary>
        public void LoadReportAndExportSetupWindow()
        {
            #region Variable Declarations
            WinMenuBar uIApplicationMenuBar = this.UISmartViewRecipeManagWindow.UIApplicationMenuBar;
            #endregion

            // Click 'Application' menu bar
            Mouse.Click(uIApplicationMenuBar, new Point(356, 45));
        }
        /// <summary>
        /// AssignCameraToView
        /// </summary>
        public void LoadCameraStatusWindow()
        {
            #region Variable Declarations
            WinMenuBar  uIApplicationMenuBar         = this.UISmartViewConfiguratiWindow.UIApplicationMenuBar;
            WinClient   uICameraStatusandAssigClient = this.UISmartViewConfiguratiWindow.UICameraStatusandAssigWindow.UIItemWindow.UICameraStatusandAssigClient;
            WinTreeItem uICamera1cam1TreeItem        = this.UISmartViewConfiguratiWindow.UIItemWindow.UIItemTree.UILineTreeItem.UIStationTreeItem.UIView1TreeItem.UICamera1cam1TreeItem;
            #endregion

            FocusConfigurationManager();

            // Click 'Application' menu bar
            Mouse.Click(new Point(164, 37));

            // Click 'Camera Status and Assignment' client
            Mouse.Click(uICameraStatusandAssigClient, new Point(143, 28));
        }
示例#9
0
        /// <summary>
        /// AssignCameraToView
        /// </summary>
        public void AssignCameraToView()
        {
            #region Variable Declarations
            WinMenuBar  uIApplicationMenuBar         = this.UISmartViewConfiguratiWindow.UIApplicationMenuBar;
            WinClient   uICameraStatusandAssigClient = this.UISmartViewConfiguratiWindow.UICameraStatusandAssigWindow.UIItemWindow.UICameraStatusandAssigClient;
            WinTreeItem uICamera1cam1TreeItem        = this.UISmartViewConfiguratiWindow.UIItemWindow.UIItemTree.UILineTreeItem.UIStationTreeItem.UIView1TreeItem.UICamera1cam1TreeItem;
            #endregion

            FocusConfigurationManager();

            // Click 'Application' menu bar
            Mouse.Click(new Point(164, 37));

            // Click 'Camera Status and Assignment' client
            Mouse.Click(uICameraStatusandAssigClient, new Point(143, 28));

            // Move 'Camera Status and Assignment' client from (102, 23) to 'Line' -> 'Station' -> 'View 1' -> 'Camera 1 (cam1)' tree item (58, 11)
            uICamera1cam1TreeItem.EnsureClickable(new Point(58, 11));
            Mouse.StartDragging(uICameraStatusandAssigClient, new Point(102, 23));
            Mouse.StopDragging(uICamera1cam1TreeItem, new Point(58, 11));
        }
示例#10
0
 public WinMenuItem GetMenuBarMenuItem(string name, string type)
 {
     this.mUIAXCWindow = new UIAXCWindow();
     WinMenuBar mUIMenuBar = new WinMenuBar(mUIAXCWindow);
     mUIMenuBar.WaitForControlReady();
     WinMenuItem uIControl = new WinMenuItem(mUIMenuBar);
     uIControl.SearchProperties.Add("ControlType", "MenuItem");
     uIControl.SearchProperties.Add("Name", "Trial balance");
     uIControl.WaitForControlReady();
     return uIControl;
 }
示例#11
0
        public void AutomateVS()
        {
            //ApplicationUnderTest app = ApplicationUnderTest.Launch(@"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe");
            WinWindow mainwindow = new WinWindow();

            mainwindow.SearchProperties.Add(WinWindow.PropertyNames.Name, "Start Page - Microsoft Visual Studio");
            WinMenuBar mainmenubar = new WinMenuBar(mainwindow);

            //mainmenubar.SearchProperties.Add(WinMenuBar.PropertyNames.Name, "MenuBar");
            //WinMenuItem filemenuitem = new WinMenuItem(mainmenubar);
            //filemenuitem.SearchProperties.Add(WinMenuItem.PropertyNames.Name, "File");
            //Mouse.Click(filemenuitem);
            //Thread.Sleep(1000);

            //WpfMenuItem newMenuItem = new WpfMenuItem(filemenuitem);
            //newMenuItem.SearchProperties.Add(WpfMenuItem.PropertyNames.Name, "New");
            //newMenuItem.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            ////Mouse.Hover(newMenuItem);

            //WpfMenuItem newProject = new WpfMenuItem(newMenuItem);
            //newProject.SearchProperties.Add(WpfMenuItem.PropertyNames.Name, "Project...");
            //newProject.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            //Mouse.Click(newProject);

            //WpfWindow newprojectwindow = new WpfWindow(mainwindow);
            //newprojectwindow.SearchProperties.Add(WinWindow.PropertyNames.Name, "New Project");
            //newprojectwindow.DrawHighlight();
            //WpfControl installedDatagrid = new WpfControl(newprojectwindow);

            //installedDatagrid.SearchProperties[WpfControl.PropertyNames.ControlType] = "DataItem";
            //installedDatagrid.SearchProperties[WpfControl.PropertyNames.AutomationId] = "Installed";
            //WpfExpander expand = new WpfExpander(installedDatagrid);
            //WpfTree installedTreeView = new WpfTree(expand);
            //installedTreeView.SearchProperties.Add(WpfTree.PropertyNames.AutomationId, "Installed");

            ////installedTreeView.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            //installedTreeView.DrawHighlight();
            //WpfTreeItem tempTreeItem = new WpfTreeItem(installedTreeView);
            //tempTreeItem.SearchProperties.Add(WpfTreeItem.PropertyNames.AutomationId, "Templates");
            ////tempTreeItem.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            //tempTreeItem.DrawHighlight();

            //WpfTreeItem visualCtreeItem = new WpfTreeItem(tempTreeItem);
            //visualCtreeItem.SearchProperties.Add(WpfTreeItem.PropertyNames.AutomationId, "Visual C#");
            ////visualCtreeItem.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            //visualCtreeItem.DrawHighlight();
            //expand.Expanded = true;
            //WpfTreeItem testTreeItem = new WpfTreeItem(visualCtreeItem);

            //testTreeItem.SearchProperties.Add(WpfTreeItem.PropertyNames.AutomationId, "Test");
            ////testTreeItem.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            //testTreeItem.DrawHighlight();

            //Mouse.Click(testTreeItem);

            //WpfButton okbutton = new WpfButton(newprojectwindow);
            //okbutton.SearchProperties.Add(WpfButton.PropertyNames.Name, "OK");
            //Mouse.Click(okbutton);

            WpfWindow MainWindow1 = new WpfWindow();

            MainWindow1.SearchProperties.Add(WinWindow.PropertyNames.Name, "CodedUITestProject6 - Microsoft Visual Studio");

            MainWindow1.DrawHighlight();


            WinWindow Generatetest = new WinWindow();

            Generatetest.SearchProperties.Add(WinWindow.PropertyNames.Name, "Generate Code for Coded UI Test");
            // Generatetest.SearchProperties.Add(WinWindow.PropertyNames.ClassName, "Generate Code for Coded UI Test");
            //"WindowsForms10.Window", PropertyExpressionOperator.Contains


            // WpfButton OkButton = new WpfButton(Generatetest);
            // OkButton.SearchProperties.Add(WpfButton.PropertyNames.AutomationId, "CancelButton");


            //// this.UIMap.RecordedMethod2();
            // Mouse.Click(OkButton);


            WpfButton TestExplorerTab = new WpfButton(MainWindow1);

            //  TestExplorerTab.SearchProperties.Add(WpfButton.PropertyNames.AutomationId, "Text");
            TestExplorerTab.SearchProperties.Add(WpfButton.PropertyNames.Name, "Test Explorer");
            // TestExplorerTab.DrawHighlight();
            // Mouse.Click(TestExplorerTab);

            WpfPane TextExplorerpane = new WpfPane(MainWindow1);

            TextExplorerpane.SearchProperties.Add(WpfControl.PropertyNames.AutomationId, "PART_HwndHost");
            //TextExplorerpane.SearchProperties[WpfControl.PropertyNames.ClassName] = "Uia.SearchControl";
            // TextExplorerpane.SearchProperties.Add(WpfControl.PropertyNames.Name, "Test Explorer");
            //var controls=TextExplorerpane.FindMatchingControls();

            //TextExplorerpane.DrawHighlight();
            WpfCustom customsearch = new WpfCustom(TextExplorerpane);

            customsearch.SearchProperties.Add(WpfCustom.PropertyNames.AutomationId, "SearchControl");

            WpfText TestExplorerSearchText = new WpfText(customsearch);
            //TestExplorerSearchText.SearchProperties.Add(WpfText.PropertyNames.AutomationId, "PART_SearchBox");
            var controls = TestExplorerSearchText.FindMatchingControls();

            TestExplorerSearchText.DrawHighlight();
            Mouse.Click(TestExplorerSearchText);
        }
示例#12
0
 public VsMenuBar(UITestControl parentWindow)
 {
     menubar = new WinMenuBar(parentWindow);
     menubar.SearchProperties.Add(WinMenuBar.PropertyNames.Name, "MenuBar");
 }
示例#13
0
        static void OpenDocument(string filename)
        {
            var window = GetWordWindow();
            var ribbonWindow = GetWordRibbon(window);

            var ribbonControl = new WinControl(ribbonWindow);
            ribbonControl.SearchProperties[UITestControl.PropertyNames.Name] = "Ribbon";
            ribbonControl.SearchProperties[UITestControl.PropertyNames.ControlType] = "PropertyPage";
            ribbonControl.WindowTitles.Add("Document1 - Word");

            var fileButton = new WinButton(ribbonControl);
            fileButton.SearchProperties[WinButton.PropertyNames.Name] = "File Tab";
            fileButton.WindowTitles.Add("Document1 - Word");

            Mouse.Click(fileButton);

            var fileMenu = new WinMenuBar(ribbonWindow);
            fileMenu.SearchProperties[WinMenu.PropertyNames.Name] = "File";
            fileMenu.WindowTitles.Add("Document1 - Word");

            var openTab = new WinTabPage(fileMenu);
            openTab.SearchProperties[WinTabPage.PropertyNames.Name] = "Open";
            openTab.WindowTitles.Add("Document1 - Word");

            Mouse.Click(openTab);

            var itemGroup = new WinGroup(window);
            itemGroup.WindowTitles.Add("Document1 - Word");

            var computerTab = new WinTabPage(itemGroup);
            computerTab.SearchProperties[WinTabPage.PropertyNames.Name] = "Computer";
            Mouse.Click(computerTab);

            var pickaFolderGroup = new WinGroup(window);
            pickaFolderGroup.SearchProperties[WinControl.PropertyNames.Name] = "Pick a Folder";

            var browseButton = new WinButton(pickaFolderGroup);
            browseButton.SearchProperties[WinButton.PropertyNames.Name] = "Browse";
            Mouse.Click(browseButton);

            var openDlg = new WinWindow();
            openDlg.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32770";
            openDlg.WindowTitles.Add("Open");

            var openDlg1 = new WinWindow(openDlg);
            openDlg1.SearchProperties[WinWindow.PropertyNames.ControlId] = "1148";
            openDlg1.WindowTitles.Add("Open");

            var fileNameCombo = new WinComboBox(openDlg1);
            fileNameCombo.SearchProperties[WinComboBox.PropertyNames.Name] = "File name:";
            fileNameCombo.EditableItem = filename;

            var fileNameEdit = new WinEdit(openDlg1);
            fileNameEdit.SearchProperties[WinEdit.PropertyNames.Name] = "File name:";

            Keyboard.SendKeys(fileNameEdit, "{Enter}", ModifierKeys.None);
        }