I was writing some tests and try to validate that some system messagebox is popping up. Like in http://www.dotnetperls.com/messagebox-show. However, the class MessageBox is for creating the messagebox. How shall I capture and validate an system generated one and operate on it?
eg: The actions are:
1.click on some execute file.
2.validate a warning messagebox pop up
3.click on yes/no on the messagebox
Any hint please?
One choice is to use White automation framework.
For example:
Window messageBox = WindowFactory.Desktop
.DesktopWindows()
.Find(w => w.Title.Contains("MessageBoxTitle"));
Button ok = messageBox.Get<Button>(SearchCriteria.ByText("OK"));
ok.Click();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With