• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UITestControl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UITestControl的典型用法代码示例。如果您正苦于以下问题:C# UITestControl类的具体用法?C# UITestControl怎么用?C# UITestControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UITestControl类属于命名空间,在下文中一共展示了UITestControl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SelectRowFromTable

 public static WinRow SelectRowFromTable(UITestControl windowProperties, string tableName, string rowName)
 {
     var table = (WinTable)Actions.GetWindowChild(windowProperties, tableName);
     var row = table.Container.SearchFor<WinRow>(new { Name = rowName });
     row.SetFocus();
     return row;
 }
开发者ID:k3foru,项目名称:WinAppTestingFramework,代码行数:7,代码来源:TableActions.cs


示例2: GetWindowProperties

 public static UITestControl GetWindowProperties(UITestControl container, string windowName)
 {
     return CodedUIExtension.SearchFor<WinWindow>(container.Container, new
     {
         Name = windowName
     });
 }
开发者ID:k3foru,项目名称:WinAppTestingFramework,代码行数:7,代码来源:Actions.cs


示例3: PinPane

        public void PinPane()
        {
            // Find the explorer main window
            UITestControl anItem = this.UIBusinessDesignStudioWindow;
            anItem.Find();

            // Find the explorer sub window
            UITestControl DocManager = new UITestControl(anItem);
            DocManager.SearchProperties["AutomationId"] = "UI_DocManager_AutoID";
            DocManager.Find();

            // Find the left pane window
            UITestControl DockLeft = new UITestControl(DocManager);
            DockLeft.SearchProperties["AutomationId"] = "DockLeft";
            DockLeft.Find();

            // Find the tab page window
            UITestControlCollection dockLeftChildren = DockLeft.GetChildren()[0].GetChildren();
            //var TabPage = dockLeftChildren.FirstOrDefault(c => c.FriendlyName == "Explorer");
            var TabPage = dockLeftChildren[0];

            // Find the explorer sub window
            UITestControl ExplorerPane = new UITestControl(TabPage);
            ExplorerPane.SearchProperties["AutomationId"] = "UI_ExplorerPane_AutoID";
            ExplorerPane.Find();
            ExplorerPane.DrawHighlight();

            // Find the pin
            UITestControlCollection explorerChildren = ExplorerPane.GetChildren();
            var unpinControl = explorerChildren.First(c => c.FriendlyName == "unpinBtn");
            Mouse.Click(unpinControl);
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:32,代码来源:ExplorerUIMap.Designer.cs


示例4: UIContextMenu

 public UIContextMenu(UITestControl searchLimitContainer) : 
         base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[WinMenu.PropertyNames.Name] = "Контекст";
     #endregion
 }
开发者ID:Elufimov,项目名称:CodedUISpecFlowBootstrap,代码行数:7,代码来源:ContextMenu.Designer.cs


示例5: UIItemWindow

 public UIItemWindow(UITestControl searchLimitContainer)
     : base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[WinWindow.PropertyNames.ControlId] = "12300";
     #endregion
 }
开发者ID:pjagga,项目名称:SeleniumMSTestVS2013,代码行数:7,代码来源:BPayFilePage.cs


示例6: GenerateUIMap

        public void GenerateUIMap()
        {
            string baseUIMapFileName = @"C:\Users\yingzhu.SAGESGROUP\Documents\Visual Studio 2010\Projects\TestSln\CalenderDemo";
            string uimapFileName = System.IO.Path.Combine(baseUIMapFileName, "DownloadPerformanceWindow.uitest");

            UITest uiTest = UITest.Create(uimapFileName);
            UIMap newMap = new UIMap();
            newMap.Id = "UIMap";
            uiTest.Maps.Add(newMap);
            UITestControl root;
            string launchAppFileName = System.Configuration.ConfigurationManager.AppSettings["LaunchAppFileName"];
            if (!string.IsNullOrEmpty(launchAppFileName))
            {
                root = ApplicationUnderTest.Launch(System.Configuration.ConfigurationManager.AppSettings["LaunchAppFileName"]);
            }
            else
            {
                root = new UITestControl();
                root.TechnologyName = "MSAA";
                root.SearchProperties[WinWindow.PropertyNames.Name] = "Download Performance";
                root.SearchProperties[WinWindow.PropertyNames.ControlName] = "DownloadPerformanceDialog";
                root.WindowTitles.Add("Download Performance");
            }
            GetAllChildren(root, uiTest.Maps[0]);
            uiTest.Save(uimapFileName);
        }
开发者ID:herno,项目名称:CodedUITestProject,代码行数:26,代码来源:GenerateUIMap.cs


示例7: LargeViewTextboxesEnterTestData

        public void LargeViewTextboxesEnterTestData(ToolType tool, UITestControl theTab)
        {
            //Find the start point
            UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start");
            Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200);

            // Drag the tool onto the workflow               
            ToolboxUIMap.DragControlToWorkflowDesigner(tool, workflowPoint1);

            WorkflowDesignerUIMap.OpenCloseLargeView(tool, theTab);

            // Add the data!


            List<UITestControl> listOfTextboxes = GetAllTextBoxesFromLargeView(tool.ToString(), theTab);

            int counter = 0;
            foreach(var textbox in listOfTextboxes)
            {
                WpfEdit tb = textbox as WpfEdit;
                if(tb != null && !tb.IsPassword)
                {
                    tb.SetFocus();
                    SendKeys.SendWait("[[theVar" + counter.ToString(CultureInfo.InvariantCulture) + "]]");
                }

                counter++;
            }
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:29,代码来源:LargeViewUtilMethods.cs


示例8: getControl

 public UITestControl getControl(string tabName, string buttonText)
 {
     UITestControl returnControl = new UITestControl();
     WpfTabList uIRibbonTabList = this.UIBusinessDesignStudioWindow.UIRibbonTabList;
     //int tabCount = uIRibbonTabList.Tabs.Count;
     foreach (WpfTabPage buttonList in uIRibbonTabList.Tabs)
     {
         if (buttonList.FriendlyName == tabName)
         {
             UITestControlCollection buttonListChildren = buttonList.GetChildren();
             foreach (UITestControl buttonGroup in buttonListChildren)
             {
                 foreach (var potentialButton in buttonGroup.GetChildren())
                 {
                     if (potentialButton.GetChildren().Count > 0)
                     {
                         UITestControlCollection buttonProperties = potentialButton.GetChildren();
                         string friendlyName = buttonProperties[0].FriendlyName;
                         if (friendlyName == buttonText)
                         {
                             return (UITestControl)buttonProperties[0];
                         }
                     }
                 }
             }
         }
     }
     return null;
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:29,代码来源:RibbonUIMap.Designer.cs


示例9: OpenRecordFromTable

        public static bool OpenRecordFromTable(UITestControl windowInstence, string tableControlName, string columnName, string JoNumber)
        {
            
            var tableName = Actions.GetWindowChild(windowInstence, tableControlName);
            var table = (WinTable)tableName;
            
            foreach (var rowC in table.Rows)
            {
                rowC.SetFocus();
                var rowHeader = table.Container.SearchFor<WinCell>(new { Name = columnName });
                var callValue = rowHeader.GetProperty("Value").ToString();

                if (callValue == JoNumber)
                {
                    Mouse.Click(rowHeader);
                    Mouse.DoubleClick(rowHeader);
                    break;
                }

            }

            var row = table.Container.SearchFor<WinRow>(new { Name = "DispatchJobOrderDetailSummary row 1" });
            var cell = row.Container.SearchFor<WinCell>(new { Name = "Job Order #" });
            Globals.JobOrderNo = cell.Value;
            Mouse.DoubleClick(cell);

            var profileWindow = JobOrderProfileWindowProperties();
            return profileWindow.Exists;
        }
开发者ID:kkodandarama,项目名称:EllisWinAppTest,代码行数:29,代码来源:OpenJobOrder.cs


示例10: UIEllisTitleBar

 public UIEllisTitleBar(UITestControl searchLimitContainer)
     : base(searchLimitContainer)
 {
     #region Search Criteria
     WindowTitles.Add(Window.Name);
     #endregion
 }
开发者ID:k3foru,项目名称:WinAppTestingFramework,代码行数:7,代码来源:TitlebarActions.cs


示例11: LoginUserAndShowHomeOld

        public void LoginUserAndShowHomeOld()
        {
            // Entsprechenden Testdatensatz generieren
            var user = new User("eric", "password");

            // Login-Elemente suchen udn füllen
            var usrTxtBox = new UITestControl();
            var pwTxtBox = new UITestControl();
            var btn = new UITestControl();

            // searchproperties hinzufügen und element suchen
            usrTxtBox.SearchProperties.Add("AutomationId", "username",PropertyExpressionOperator.EqualTo);
            usrTxtBox = usrTxtBox.FindMatchingControls()[0];

            // searchproperties hinzufügen und element suchen
            pwTxtBox.SearchProperties.Add("AutomationId", "password", PropertyExpressionOperator.EqualTo);
            pwTxtBox = pwTxtBox.FindMatchingControls()[0];

            // searchproperties hinzufügen und element suchen
            btn.SearchProperties.Add("AutomationId", "loginbtn", PropertyExpressionOperator.EqualTo);
            btn = btn.FindMatchingControls()[0];

            // Setze entsprechende Werte
            usrTxtBox.SetProperty("Text", user.Name);
            pwTxtBox.SetProperty("Text", user.Password);

            // LoginButton Clicken
            Mouse.Click(btn);

            // Die Willkommen-Message suchen und entsprechend verifizieren
            var welcomemsg = new UITestControl();
            welcomemsg.SearchProperties.Add("AutomationId", "welcomemsg", PropertyExpressionOperator.EqualTo);

            StringAssert.Contains(welcomemsg.GetProperty("Text").ToString(), "Willkommen, eric");
        }
开发者ID:erickubenka,项目名称:code-examples,代码行数:35,代码来源:HomeTest.cs


示例12: ControlBase

        /// <summary>
        /// Initializes a new instance of the <see cref="ControlBase"/> class.
        /// </summary>
        /// <param name="sourceControl">The source control.</param>
        protected ControlBase(UITestControl sourceControl)
        {
            if (sourceControl == null)
                throw new ArgumentNullException("sourceControl");

            this.sourceControl = sourceControl;
        }
开发者ID:kasthurk,项目名称:cuite,代码行数:11,代码来源:ControlBase.cs


示例13: ChooseDestinationServerWithKeyboard

 public void ChooseDestinationServerWithKeyboard(UITestControl theTab, string serverName)
 {
     UITestControl destinationServerList = GetDestinationServerList(theTab);
     Mouse.Click(destinationServerList);
     Keyboard.SendKeys("{UP}{ENTER}");
     Playback.Wait(2000);
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:7,代码来源:DeployViewUIMap.cs


示例14: GetWindowChild

 public static UITestControl GetWindowChild(UITestControl control, string controlName)
 {
     return CodedUIExtension.SearchFor<WinWindow>(control.Container, new
     {
         ControlName = controlName
     }).GetChildren()[3];
 }
开发者ID:k3foru,项目名称:WinAppTestingFramework,代码行数:7,代码来源:Actions.cs


示例15: Adorner_ClickFixErrors

        public bool Adorner_ClickFixErrors(UITestControl theTab, string controlAutomationId)
        {
            UITestControl aControl = FindControlByAutomationId(theTab, controlAutomationId);
            UITestControlCollection testFlowChildCollection = aControl.GetChildren();
            if(testFlowChildCollection.Count > 0)
            {
                foreach(UITestControl theControl in testFlowChildCollection)
                {
                    if(theControl.GetProperty("AutomationID").ToString() == "SmallViewContent")
                    {
                        var smallViewControls = theControl.GetChildren();
                        foreach(var smallViewControl in smallViewControls)
                        {
                            if(smallViewControl.ControlType == ControlType.Button && smallViewControl.Height == 22)
                            {
                                Point newPoint = new Point(smallViewControl.Left + 10, smallViewControl.Top + 10);
                                Mouse.Click(newPoint);
                            }

                        }
                    }
                }
            }
            else
            {
                return false;
            }
            return true;
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:29,代码来源:WorkflowDesignerUIMap.cs


示例16: ClickOnButton

 //method to click on button in any window
 // Provide window instance as 1st parameter and button name as 2nd parameter
 //public static void ClickOnButton(UITestControl windowInstence, string butName)
 //{
 //    var group = windowInstence.Container.SearchFor<WinGroup>(new { Name = "" });
 //    var btnControl = group.Container.SearchFor<WinButton>(new { Name = butName });
 //    var btnControlcollection = Actions.GetControlCollection(btnControl);
 //    foreach (var control in btnControlcollection)
 //    {
 //        //MouseActions.Click(control);
 //        control.SetFocus();
 //        SendKeys.SendWait("{ENTER}");
 //    }
 //}
 public static void ClickOnButton(UITestControl windowInstence, string butName)
 {
     var winGroup = windowInstence.Container.SearchFor<WinGroup>(new { Name = "" });
     var btnControl = winGroup.Container.SearchFor<WinButton>(new { Name = butName });
     btnControl.SetFocus();
     MouseActions.Click(btnControl);
 }
开发者ID:k3foru,项目名称:WinAppTestingFramework,代码行数:21,代码来源:Factory.cs


示例17: ChooseSourceServerWithKeyboard

 public void ChooseSourceServerWithKeyboard(UITestControl theTab, string serverName)
 {
     UITestControl sourceServerList = GetSourceServerList(theTab);
     Mouse.Click(sourceServerList);
     Keyboard.SendKeys("{DOWN}{ENTER}");
     Playback.Wait(2000);
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:7,代码来源:DeployViewUIMap.cs


示例18: DragControlToWorkflowDesigner

        /// <summary>
        /// Drags a control from the Toolbox to the Workflow
        /// </summary>
        /// <param name="toolName">The name of the control you to drag - Eg: Assign, Calculate, Etc</param>
        /// <param name="tabToDropOnto">The tab on which to drop the control</param>
        /// <param name="pointToDragTo">The point you wish to drop the control</param>
        /// <param name="getDroppedActivity">Get and return the dropped control</param>
        public UITestControl DragControlToWorkflowDesigner(ToolType tool, UITestControl tabToDropOnto, Point pointToDragTo = new Point(), bool getDroppedActivity = true)
        {
            UITestControl theControl = FindToolboxItemByAutomationId(tool);
            theControl.WaitForControlEnabled();
            if(pointToDragTo.X == 0 && pointToDragTo.Y == 0)
            {
                UITestControl theStartButton = WorkflowDesignerUIMap.FindStartNode(tabToDropOnto);
                pointToDragTo = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200);
            }

            Mouse.StartDragging(theControl, MouseButtons.Left);
            Playback.Wait(20);
            Mouse.StopDragging(pointToDragTo);
            Playback.Wait(100);

            UITestControl resourceOnDesignSurface = null;
            if(getDroppedActivity)
            {
                resourceOnDesignSurface = WorkflowDesignerUIMap.FindControlByAutomationId(tabToDropOnto, tool.ToString());
                int counter = 0;
                while(resourceOnDesignSurface == null && counter < 5)
                {
                    Playback.Wait(1000);
                    resourceOnDesignSurface = WorkflowDesignerUIMap.FindControlByAutomationId(tabToDropOnto, tool.ToString());
                    Playback.Wait(500);
                    counter++;
                }
            }

            return resourceOnDesignSurface;
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:38,代码来源:ToolboxUIMap.cs


示例19: SelectAnInvoiceNumberFromGrid

 private static void SelectAnInvoiceNumberFromGrid(UITestControl prop)
 {
     var row = TableActions.SelectRowFromTable(prop, ARControls.UnpaidInvoiceGrid,
         "CollectionInvoiceSummaryDomain row 1");
     var cell = row.Container.SearchFor<WinCell>(new {Value = "False"});
     Mouse.Click(cell);
 }
开发者ID:kkodandarama,项目名称:EllisWinAppTest,代码行数:7,代码来源:ARWindow.cs


示例20: UIItemWindow

 public UIItemWindow(UITestControl searchLimitContainer)
     : base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[WinWindow.PropertyNames.ControlId] = "12297";
     this.WindowTitles.Add("‪Microsoft Dynamics AX‬ (‎‪1‬)‎");
     #endregion
 }
开发者ID:pjagga,项目名称:SeleniumMSTestVS2013,代码行数:8,代码来源:BPayReversalPaymentFileSendPage.cs



注:本文中的UITestControl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UITextField类代码示例发布时间:2022-05-24
下一篇:
C# UITapGestureRecognizer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap