我想测试Outlook应用程序并通过使用White Stack框架向我发送电子邮件。我实现了单击“新建项目”的代码,然后出现了新窗口。我想将我的邮件输入到“文本框”,但我不知道如何访问第二个窗口“无标题-消息(HTML)”。 Photo
[TestMethod]
public void mail()
{
var application = Application.Launch(appPatch);
Thread.Sleep(2000);
var window = application.GetWindow(appTitle, InitializeOption.NoCache);
SearchCriteria searchCriteriaNewEmail = SearchCriteria.ByText("New Email");
Button buttonNewEmail = window.Get<Button>(searchCriteriaNewEmail);
buttonNewEmail.Click();
Thread.Sleep(1000);
string windowTitle = "Untitled - Message(HTML)";
var window2 = application.GetWindow(windowTitle, InitializeOption.NoCache);
SearchCriteria searchCriteriaTo = SearchCriteria.ByText("To");
TextBox tbxTo = window2.Get<TextBox>(searchCriteriaTo);
tbxTo.BulkText = "mymail@gmail.com";
Thread.Sleep(2000);
window.Close();
}