本文整理汇总了C#中UITestControl.Find方法的典型用法代码示例。如果您正苦于以下问题:C# UITestControl.Find方法的具体用法?C# UITestControl.Find怎么用?C# UITestControl.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UITestControl
的用法示例。
在下文中一共展示了UITestControl.Find方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: CloseDebugWindow_ByCancel
public void CloseDebugWindow_ByCancel()
{
WpfWindow debugWindow = GetDebugWindow();
UITestControl theControl = new UITestControl(debugWindow);
theControl.SearchProperties.Add("AutomationId", "UI_Cancelbtn_AutoID");
theControl.Find();
Mouse.Click(theControl, new Point(5, 5));
}
示例3: GetUpdateButton
private UITestControl GetUpdateButton()
{
UITestControl theControl = this.UIBusinessDesignStudioWindow.UIItemCustom;
theControl.Find();
UITestControl updateButton = new UITestControl(theControl);
updateButton.SearchProperties[WpfTree.PropertyNames.AutomationId] = "UI_AddRemovebtn_AutoID";
updateButton.Find();
return updateButton;
}
示例4: GetIE
private UITestControl GetIE()
{
UITestControl ie = new UITestControl();
ie.SearchProperties[UITestControl.PropertyNames.ClassName] = "IEFrame";
ie.SearchProperties[UITestControl.PropertyNames.ControlType] = "Window";
ie.TechnologyName = "MSAA";
ie.Find();
return ie;
}
示例5: GetIEBodyText
public string GetIEBodyText()
{
UITestControl ie = GetIE();
UITestControl subMap = new UITestControl(ie);
subMap.SearchProperties[UITestControl.PropertyNames.ClassName] = "Internet Explorer_Server";
subMap.Find();
UITestControl bodyText = subMap.GetChildren()[0];
string body = bodyText.GetProperty("InnerText").ToString();
return body;
}
示例6: GetExplorerEditBtn
public UITestControl GetExplorerEditBtn()
{
// Find the explorer main window
UITestControl anItem = this.UIBusinessDesignStudioWindow.UIExplorerCustom;
anItem.Find();
// Find the explorer sub window
UITestControl explorerMenu = new UITestControl(anItem);
explorerMenu.SearchProperties["AutomationId"] = "Explorer";
explorerMenu.Find();
UITestControl serverDDL = new UITestControl(explorerMenu);
serverDDL.SearchProperties["AutomationId"] = "UI_ExplorerEditBtn_AutoID";
serverDDL.Find();
return serverDDL;
}
示例7: CacheComponentFound
private static void CacheComponentFound(UITestControl control, string name)
{
control.Find();
if (!control.Exists)
{
throw new Exception(CONTROL_NOT_FOUND_EXCEPTION);
}
_cache.Add(name, control);
}
示例8: GetIntellisenseItem
// Intellisense Box
public UITestControl GetIntellisenseItem(int id)
{
// Get the Studio
WpfWindow theStudio = new WpfWindow();
theStudio.SearchProperties[UITestControl.PropertyNames.Name] = TestBase.GetStudioWindowName();
theStudio.SearchProperties.Add(new PropertyExpression(UITestControl.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));
theStudio.WindowTitles.Add(TestBase.GetStudioWindowName());
theStudio.Find();
UITestControl itelliList = new UITestControl(theStudio);
itelliList.SearchProperties[WpfControl.PropertyNames.AutomationId] = "PART_ItemList";
itelliList.Find();
var itelliListItem = itelliList.GetChildren()[id];
return itelliListItem;
//PART_ItemList
}
示例9: WaitForControl
/// <summary>
/// Waits for control to exist, be enabled, and ready
/// </summary>
/// <param name="control">Target UITestControl</param>
public static void WaitForControl(UITestControl control)
{
control.Find();
control.WaitForControlExist();
control.WaitForControlEnabled();
control.WaitForControlReady();
}
示例10: ClearSearch
public void ClearSearch()
{
// Base control
UITestControl theControl = UIBusinessDesignStudioWindow.UIDebugOutputCustom;
theControl.Find();
// Sub button
var srchBtn = new UITestControl(theControl);
srchBtn.SearchProperties.Add("AutomationId", "UI_DataListSearchtxt_AutoID");
srchBtn.Find();
// The clicking is a bit slow for some reason - Need to investigate
Mouse.Click(srchBtn);
Keyboard.SendKeys("^a");
Keyboard.SendKeys("{DELETE}");
}
示例11: ClickClose
public void ClickClose()
{
// Base control
UITestControl theControl = UIBusinessDesignStudioWindow.UIDebugOutputCustom;
theControl.Find();
// Sub button
var closeBtn = new UITestControl(theControl);
closeBtn.SearchProperties.Add("AutomationId", "closeBtn");
closeBtn.Find();
// The clicking is a bit slow for some reason - Need to investigate
Mouse.Click(closeBtn);
}
示例12: getControl
UITestControl getControl(ControlType controlType, BrowserWindow browser, string buttonId)
{
UITestControl button = new UITestControl(browser);
button.TechnologyName = "Web";
var controlTypeString = controlType.ToString();
button.SearchProperties.Add("ControlType", controlTypeString);
button.SearchProperties.Add("Id", buttonId);
var buttons = button.FindMatchingControls();
button.Find();
return button;
}
示例13: GetWorkflowNotSavedButtons
private UITestControlCollection GetWorkflowNotSavedButtons(string windowTitle = "Workflow not saved...")
{
// Workflow not saved...
UITestControl theWindow = new UITestControl();
theWindow.TechnologyName = "MSAA";
theWindow.SearchProperties["Name"] = windowTitle;
theWindow.SearchProperties["ControlType"] = "Window";
theWindow.Find();
UITestControlCollection firstChildren = theWindow.GetChildren();
var ctrls = firstChildren.Where(c => c.ClassName == "Uia.Button");
UITestControlCollection saveDialogButtons = new UITestControlCollection();
foreach(UITestControl control in ctrls)
{
saveDialogButtons.Add(control);
}
return saveDialogButtons;
}