当前位置: 首页>>代码示例>>C#>>正文


C# UITestControl.SetFocus方法代码示例

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


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

示例1: MouseClickOnCoordinates

 //public static void MouseClickOnCoordinates(UITestControl control)
 //{
 //  control.WaitForControlReady();
 //  control.SetFocus();
 //  Point screenCoordinate = new Point();
 //  // ISSUE: explicit reference operation
 //  // ISSUE: variable of a reference type
 //  Point& local = @screenCoordinate;
 //  Rectangle boundingRectangle = control.BoundingRectangle;
 //  int num1 = boundingRectangle.Width / 2;
 //  boundingRectangle = control.BoundingRectangle;
 //  int x1 = boundingRectangle.X;
 //  int x2 = num1 + x1;
 //  boundingRectangle = control.BoundingRectangle;
 //  int num2 = boundingRectangle.Height / 2;
 //  boundingRectangle = control.BoundingRectangle;
 //  int y1 = boundingRectangle.Y;
 //  int y2 = num2 + y1;
 //  // ISSUE: explicit reference operation
 //  ^local = new Point(x2, y2);
 //  Mouse.Click(screenCoordinate);
 //}
 public static void MouseClickOnCoordinates(UITestControl control)
 {
     control.WaitForControlReady();
     control.SetFocus();
     var clickPoints = new Point(control.BoundingRectangle.Width / 2 + control.BoundingRectangle.X,
         control.BoundingRectangle.Height / 2 + control.BoundingRectangle.Y);
     Mouse.Click(clickPoints);
 }
开发者ID:k3foru,项目名称:WinAppTestingFramework,代码行数:30,代码来源:Actions.cs

示例2: SetText

 public static void SetText(UITestControl control, string text)
 {
     control.WaitForControlReady();
     control.SetFocus();
     MouseClickOnCoordinates(control);
     if (!control.GetProperty("Value").Equals(null))
     {
         SendKeys.SendWait("^A");
         SendKeys.SendWait("{DELETE}");
     }
     SendKeys.SendWait("{HOME}");
     Playback.Wait(1000);
     SendKeys.SendWait(text);
 }
开发者ID:k3foru,项目名称:WinAppTestingFramework,代码行数:14,代码来源:Actions.cs

示例3: hardcoded

        public static void hardcoded()
        {
            WinWindow Lwindow = new WinWindow();
            Lwindow.SearchProperties.Add(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains);
            Lwindow.SearchProperties.Add(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains);

            UITestControl eliftclient = new UITestControl(Lwindow);
            eliftclient.TechnologyName = "MSAA";
            eliftclient.SearchProperties.Add("ControlType", "Client");
            eliftclient.SearchProperties.Add("ClassName", "Internet Explorer_Server");

            UITestControl webdocument = new UITestControl(eliftclient);
            webdocument.TechnologyName = "Web";
            webdocument.SearchProperties.Add("ControlType", "Document");
            webdocument.SearchProperties.Add("Id", "params_Downhole");

            UITestControl webedit = new UITestControl(webdocument);
            webedit.TechnologyName = "Web";
            webedit.SearchProperties.Add("ControlType", "Edit");
            webedit.SearchProperties.Add("Id", "txtPerfTop");

            webedit.SetFocus();
            Mouse.Click(webedit);
            enterkeyboard("5000");
        }
开发者ID:prasannarhegde2015,项目名称:C-Advanced-Learning,代码行数:25,代码来源:Program.cs


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