我们如何跟踪来自WPF消息框而不是web的消息,以及如何以编程方式单击Coded UI Testing中确认消息框的“是”按钮?
我尝试了以下但是它不起作用:
消息框:
UITestControl msgBox = new UITestControl(App);
msgBox.TechnologyName = "MSAA";
msgBox.SearchProperties.Add("ControlType", "Text");
msgBox.SearchProperties.Add("Name", "Test cases added successfully.");
bool isExist = msgBox.Exists;
Assert.IsTrue(isExist);
确认对话'是'按钮:
UITestControl btnYes = new UITestControl(App);
btnYes.TechnologyName = "MSAA";
btnYes.SearchProperties.Add("ControlType", "Button");
btnYes.SearchProperties.Add("AutomationId", "Yes");
Mouse.Click(btnYes);
感谢您的帮助!!!