本文整理汇总了C#中UITestControl.GetChildren方法的典型用法代码示例。如果您正苦于以下问题:C# UITestControl.GetChildren方法的具体用法?C# UITestControl.GetChildren怎么用?C# UITestControl.GetChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UITestControl
的用法示例。
在下文中一共展示了UITestControl.GetChildren方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: GetAllChildren
private void GetAllChildren(UITestControl root, UIMap uiMap)
{
foreach (UITestControl child in root.GetChildren())
{
uiMap.AddUIObject(child.GetProperty(UITestControl.PropertyNames.UITechnologyElement) as IUITechnologyElement);
GetAllChildren(child, uiMap);
}
}
示例3: GetControl
protected UITestControl GetControl(string autoId, UITestControl viewControl, ControlType controlType)
{
UITestControlCollection uiTestControlCollection = viewControl.GetChildren();
UITestControl control = uiTestControlCollection.FirstOrDefault(c => ((WpfControl)c).AutomationId.Equals(autoId));
if(control != null)
{
return control;
}
throw new Exception("Couldn't find the " + autoId + " for control type " + controlType);
}
示例4: GetTextBox
private UITestControl GetTextBox(string autoId, UITestControl viewControl)
{
UITestControlCollection uiTestControlCollection = viewControl.GetChildren();
UITestControl textbox = uiTestControlCollection.FirstOrDefault(c => c.ControlType == ControlType.Edit && c.FriendlyName == autoId);
if(textbox != null)
{
return textbox;
}
throw new Exception("Couldn't find the" + autoId + " textbox.");
}
示例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: DestinationServerTreeviewExplorer
private UITestControl DestinationServerTreeviewExplorer(UITestControl theTab)
{
UITestControlCollection allChildren = DeployTabsChildren(theTab);
UITestControl targetNavigationView = new UITestControl();
foreach(UITestControl theControl in allChildren)
{
if(theControl.GetProperty("AutomationId").ToString() == "TargetNavigationView")
{
targetNavigationView = theControl;
break;
}
}
return targetNavigationView.GetChildren()[0];
}
示例7: IsRemoteExecute
public static bool IsRemoteExecute(UITestControl theStep)
{
var errorResults = theStep.GetChildren()
.ToList()
.Where(c => c.FriendlyName.Contains("Remote Connection"))
.ToList();
if(errorResults.Count == 0)
{
return false;
}
// Steps that aren't in errors still have the error text
// Due to this, we can use the visibility (AKA: If height is -1, it's hidden (And not just 1 pixel above 0...))
return errorResults[0].Height != -1;
}
示例8: GetChildByAutomationIDPathImpl
private UITestControl GetChildByAutomationIDPathImpl(UITestControl parent, int bookmark, params string[] automationIDs)
{
//Find all children
var children = parent.GetChildren();
if(children == null)
{
try
{
throw new UITestControlNotFoundException("Cannot find children of " + parent.GetProperty("AutomationID") +
" and friendly name: " + parent.FriendlyName +
" and control type: " + parent.ControlType +
" and class name: " + parent.ClassName + ".");
}
catch(NullReferenceException)
{
throw new UITestControlNotFoundException("Cannot find children of " + parent.GetProperty("AutomationID") + ".");
}
}
//Find some child
var firstChildFound = children.FirstOrDefault(child =>
{
var childId = child.GetProperty("AutomationID");
if(childId != null)
{
var childAutoId = childId.ToString();
return childAutoId.Contains(automationIDs[bookmark])
|| child.FriendlyName.Contains(automationIDs[bookmark])
|| child.ControlType.Name.Contains(automationIDs[bookmark])
|| child.ClassName.Contains(automationIDs[bookmark]);
}
return false;
});
if(firstChildFound == null)
{
throw new UITestControlNotFoundException("Cannot find " + automationIDs[bookmark] +
" control within parent" +
" with automation ID: " + parent.GetProperty("AutomationID") +
" and friendly name: " + parent.FriendlyName +
" and control type: " + parent.ControlType +
" and class name: " + parent.ClassName + ".");
}
//Return child or some child of child...
return bookmark == automationIDs.Count() - 1 ? firstChildFound : GetChildByAutomationIDPathImpl(firstChildFound, ++bookmark, automationIDs);
}
示例9: GetInputDetailsDetails
public static UITestControlCollection GetInputDetailsDetails(UITestControl outputWindow)
{
var coll = outputWindow.GetChildren();
var results = new UITestControlCollection();
for(int i = 0; i <= coll.Count; i++)
{
if(coll[i].Name.Equals("Inputs : "))
{
int j = 1;
while(!coll[i + j].Name.Equals("Outputs : "))
{
if(coll[i + j].ControlType != ControlType.Button)
results.Add(coll[i + j]);
j++;
}
return results;
}
}
return results;
}
示例10: GetWizardTitle
public string GetWizardTitle(UITestControl theTab)
{
UITestControlCollection theCollection = theTab.GetChildren();
UITestControl splurtControl = theCollection[4];
UITestControl theControl = splurtControl.GetChildren()[0].GetChildren()[1].GetChildren()[0];
return theControl.FriendlyName;
}
示例11: DoesActivityDataMappingContainText
public bool DoesActivityDataMappingContainText(UITestControl aControl, string text)
{
UITestControlCollection testFlowChildCollection = aControl.GetChildren();
foreach(UITestControl theControl in testFlowChildCollection)
{
// inputMappings
string automationId = theControl.GetProperty("AutomationID").ToString();
if(automationId == "inputMappings")
{
UITestControlCollection inputChildren = theControl.GetChildren();
foreach(UITestControl potentialRow in inputChildren)
{
if(potentialRow.ControlType.ToString() == "Row")
{
var theRow = (potentialRow as WpfRow);
if(theRow != null)
{
foreach(var cell in theRow.Cells)
{
if(cell is WpfEdit)
{
if((cell as WpfEdit).Text == text)
{
return true;
}
}
else if((cell is WpfText))
{
if((cell as WpfText).DisplayText == text)
{
return true;
}
}
}
}
}
}
}
}
return false;
}
示例12: ClickCollapseAll
public void ClickCollapseAll(UITestControl theTab)
{
UITestControlCollection theCollection = theTab.GetChildren();
UITestControl splurtControl = theCollection[4];
UITestControlCollection theControlCollection = splurtControl.GetChildren()[0].GetChildren()[0].GetChildren();
UITestControl collapseAll = theControlCollection[2];
Point p = collapseAll.GetClickablePoint();
Mouse.Click(collapseAll, p);
}
示例13: ClickRestore
public void ClickRestore(UITestControl theTab)
{
UITestControlCollection theCollection = theTab.GetChildren();
UITestControl splurtControl = theCollection[4];
UITestControlCollection theControlCollection = splurtControl.GetChildren()[0].GetChildren()[0].GetChildren();
UITestControl expandAll = theControlCollection[1];
Point p = expandAll.GetClickablePoint();
Mouse.Click(expandAll, p);
}
示例14: GetSqlBulkInsertChildren
/// <summary>
/// Gets the SQL bulk insert children.
/// </summary>
/// <param name="control">The control.</param>
/// <returns></returns>
public IEnumerable<WpfControl> GetSqlBulkInsertChildren(UITestControl control)
{
var uiTestControls = control
.GetChildren()
.Select(i => i as WpfControl)
.ToList();
uiTestControls.AddRange(control
.GetChildren()
.SelectMany(c => c.GetChildren())
.Select(i => i as WpfControl)
.ToList());
return uiTestControls;
}
示例15: GetScrollViewer
/// <summary>
/// Gets the scroll viewer.
/// </summary>
/// <param name="theTab">The tab.</param>
/// <returns></returns>
public UITestControl GetScrollViewer(UITestControl theTab)
{
foreach(var control in theTab.GetChildren())
{
if(control.ClassName == "Uia.ContentPane")
{
foreach(var contentPaneControl in control.GetChildren())
{
if(contentPaneControl.ClassName == "Uia.WorkflowDesignerView")
{
foreach(var workflowDesignerControl in contentPaneControl.GetChildren())
{
if(workflowDesignerControl.ClassName == "Uia.DesignerView")
{
foreach(var designerViewControl in workflowDesignerControl.GetChildren())
{
if(designerViewControl.FriendlyName == "scrollViewer")
{
return designerViewControl;
}
}
}
}
}
}
}
}
return null;
}