コード例 #1
0
 public static void ClearFileTransferControls()
 {
     _contentAppBarCustom = null;
     _contentFramePane    = null;
     _closeButton         = null;
     _fileTransferWindow  = null;
 }
コード例 #2
0
 public static WpfPane GetBrowserPanel()
 {
     if (_browserPanel == null)
     {
         _browserPanel = new WpfPane(GetLoginFramePane());
         _browserPanel.SearchProperties[WpfPane.PropertyNames.ClassName]    = "Uia.HwndHost";
         _browserPanel.SearchProperties[WpfPane.PropertyNames.AutomationId] = "Browser";
     }
     return(_browserPanel);
 }
コード例 #3
0
 public static WpfPane GetLoginFramePane()
 {
     if (_loginFramePane == null)
     {
         _loginFramePane = new WpfPane(GetShareConnectWindow());
         _loginFramePane.SearchProperties[WpfPane.PropertyNames.ClassName]    = "Uia.Frame";
         _loginFramePane.SearchProperties[WpfPane.PropertyNames.AutomationId] = "LoginFrame";
     }
     return(_loginFramePane);
 }
コード例 #4
0
 public static WpfPane GetContentFramePane()
 {
     if (_contentFramePane == null)
     {
         _contentFramePane = new WpfPane(GetFileTransferWindow());
         _contentFramePane.SearchProperties[WpfPane.PropertyNames.ClassName]    = "Uia.Frame";
         _contentFramePane.SearchProperties[WpfPane.PropertyNames.AutomationId] = "ContentFrame";
     }
     return(_contentFramePane);
 }
コード例 #5
0
 public static WpfPane GetWinformHostPane()
 {
     if (_winformHostPane == null)
     {
         _winformHostPane = new WpfPane(GetWin10awsTabPage());
         _winformHostPane.SearchProperties[WpfPane.PropertyNames.ClassName]    = "Uia.WindowsFormsHost";
         _winformHostPane.SearchProperties[WpfPane.PropertyNames.AutomationId] = "WinformHost";
     }
     return(_winformHostPane);
 }
コード例 #6
0
        public void Filter()
        {
            var msg  = "Default:" + Get_Grid().RowCount;
            var body = new WpfPane(Get_Grid());

            body.SearchProperties[WpfPane.PropertyNames.AutomationId] = "Body";
            var cell = new WpfCustom(body);

            cell.SearchProperties[WpfCustom.PropertyNames.ClassName] = "Uia.DataGridCellPresenter";
            var filterbox = new WpfEdit(cell);

            filterbox.Text = "Closed";
            msg           += ".AfterFilter:" + Get_Grid().RowCount;
            Assert.AreEqual("Default:12.AfterFilter:7", msg);
        }
コード例 #7
0
        public static void SetUIAItemControlValue(string name, string type, string value, WinWindow parent)
        {
            WinWindow itemWindow = new WinWindow(parent);
            itemWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));
            itemWindow.WaitForControlReady();
            WpfPane pane = new WpfPane(itemWindow);
            WpfCustom customControl = new WpfCustom(pane);
            customControl.SearchProperties[WpfControl.PropertyNames.ClassName] = "Uia.SegmentedEntry";
            customControl.WaitForControlReady();
            WpfControl uIControl = new WpfControl(customControl);
            uIControl.TechnologyName = "UIA";
            uIControl.SearchProperties.Add("ControlType", type);
            uIControl.SearchProperties.Add("AutomationId", name);
            uIControl.WaitForControlReady();

            if (type == "CheckBox")
            {
                WpfCheckBox mUICheckBox = new WpfCheckBox(uIControl);
                mUICheckBox.Checked = Convert.ToBoolean(value);
            }
            else if (type == "Edit")
            {
                WpfEdit mUIEdit = new WpfEdit(uIControl);
                mUIEdit.Text = value;
            }
        }
コード例 #8
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);
        }
コード例 #9
0
 public void Filter()
 {
     var msg = "Default:" + Get_Grid().RowCount;
     var body = new WpfPane(Get_Grid());
     body.SearchProperties[WpfPane.PropertyNames.AutomationId] = "Body";
     var cell = new WpfCustom(body);
     cell.SearchProperties[WpfCustom.PropertyNames.ClassName] = "Uia.DataGridCellPresenter";
     var filterbox = new WpfEdit(cell);
     filterbox.Text = "Closed";
     msg += ".AfterFilter:" + Get_Grid().RowCount;
     Assert.AreEqual("Default:12.AfterFilter:7", msg);
 }