我正在编写一些测试并尝试验证是否弹出了一些系统消息框。喜欢http://www.dotnetperls.com/messagebox-show .但是,类 MessageBox 用于创建消息框。我应如何捕获和验证系统生成的系统并对其进行操作?
例如: Action 是:
1.click on some execute file.
2.validate a warning messagebox pop up
3.click on yes/no on the messagebox
有什么提示吗?
最佳答案
一种选择是使用 White自动化框架。
例如:
Window messageBox = WindowFactory.Desktop
.DesktopWindows()
.Find(w => w.Title.Contains("MessageBoxTitle"));
Button ok = messageBox.Get<Button>(SearchCriteria.ByText("OK"));
ok.Click();
关于c# - 如何验证 C# 中的消息框弹出窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23546232/