本文整理汇总了C#中UITestControl类的典型用法代码示例。如果您正苦于以下问题:C# UITestControl类的具体用法?C# UITestControl怎么用?C# UITestControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UITestControl类属于命名空间,在下文中一共展示了UITestControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: GetWindowProperties
public static UITestControl GetWindowProperties(UITestControl container, string windowName)
{
return CodedUIExtension.SearchFor<WinWindow>(container.Container, new
{
Name = windowName
});
}
示例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);
}
示例4: UIContextMenu
public UIContextMenu(UITestControl searchLimitContainer) :
base(searchLimitContainer)
{
#region Search Criteria
this.SearchProperties[WinMenu.PropertyNames.Name] = "Контекст";
#endregion
}
示例5: UIItemWindow
public UIItemWindow(UITestControl searchLimitContainer)
: base(searchLimitContainer)
{
#region Search Criteria
this.SearchProperties[WinWindow.PropertyNames.ControlId] = "12300";
#endregion
}
示例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);
}
示例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++;
}
}
示例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;
}
示例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;
}
示例10: UIEllisTitleBar
public UIEllisTitleBar(UITestControl searchLimitContainer)
: base(searchLimitContainer)
{
#region Search Criteria
WindowTitles.Add(Window.Name);
#endregion
}
示例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");
}
示例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;
}
示例13: ChooseDestinationServerWithKeyboard
public void ChooseDestinationServerWithKeyboard(UITestControl theTab, string serverName)
{
UITestControl destinationServerList = GetDestinationServerList(theTab);
Mouse.Click(destinationServerList);
Keyboard.SendKeys("{UP}{ENTER}");
Playback.Wait(2000);
}
示例14: GetWindowChild
public static UITestControl GetWindowChild(UITestControl control, string controlName)
{
return CodedUIExtension.SearchFor<WinWindow>(control.Container, new
{
ControlName = controlName
}).GetChildren()[3];
}
示例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;
}