本文整理汇总了C#中WinWindow.Find方法的典型用法代码示例。如果您正苦于以下问题:C# WinWindow.Find方法的具体用法?C# WinWindow.Find怎么用?C# WinWindow.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WinWindow
的用法示例。
在下文中一共展示了WinWindow.Find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FormModel
public FormModel()
{
MainWindow = new WinWindow(By.Name("Form1"));
lbl_ChangingText = MainWindow.Find<WinText>(By.Name("lbl_ChangingText"));
btn_ChangeTxt = MainWindow.Find<WinButton>(By.Name("btn_ChangingText"));
txtBox_ChangingBox = MainWindow.Find<WinEdit>(By.Name("txtBox_ChangingText"));
}
示例2: GetOutlookAfterFeedbackWindow
private WinWindow GetOutlookAfterFeedbackWindow()
{
WinWindow theWindow = new WinWindow();
theWindow.SearchProperties[WinWindow.PropertyNames.Name] = "Some Real Live Feedback : Feedback - Message (Plain Text) ";
theWindow.Find();
return theWindow;
}
示例3: GetWindow
public static WinWindow GetWindow(this WinWindow parent, string windowTitle, bool exactMatch = false)
{
PropertyExpressionOperator expressionOperator = exactMatch
? PropertyExpressionOperator.EqualTo
: PropertyExpressionOperator.Contains;
var modalWindow = new WinWindow
{
SearchProperties =
{
new PropertyExpression(UITestControl.PropertyNames.Name, windowTitle, expressionOperator)
}
};
modalWindow.Find();
return modalWindow;
}
示例4: HtmlInputButton_UsingSearchPropertyWithValueAsKey_Succeeds
public void HtmlInputButton_UsingSearchPropertyWithValueAsKey_Succeeds()
{
//Internet Explorer may display the message: Internet Explorer restricted this webpage from running scripts or ActiveX controls.
//This security restriction prevents the alert message to appear.
//To enable running scripts on the local computer, go to Tools > Internet options > Advanced > Security > [checkmark] Allow active content to run in files on My Computer
//Arrange
using (var webPage = new TempWebPage(
@"<html>
<head>
<title>test</title>
</head>
<body>
<input type=""submit"" value=""Log In"" onclick=""alert('onclick');""/>
</body>
</html>"))
{
var browserWindow = BrowserWindow.Launch(webPage.FilePath);
HtmlInputButton button = browserWindow.Find<HtmlInputButton>(By.ValueAttribute("Log In"));
//Act
button.Click();
if (BrowserWindowUnderTest.GetCurrentBrowser() is InternetExplorer)
{
//read JavaScript alert text
WinWindow popup = new WinWindow(By.Name("Message from webpage").AndSearchProperties("ClassName=#32770"));
WinText text = popup.Find<WinText>();
Assert.AreEqual("onclick", text.DisplayText);
}
browserWindow.PerformDialogAction(BrowserDialogAction.Ok);
browserWindow.Close();
}
}