本文整理汇总了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);
}
示例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);
}
示例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");
}