We are Telerik's customer for last 4 years and use Rad Controls in our web application. We also use WebAii's testing framework for test automation.
When automated test case load application in the browser and then attempt to close the browser after completing test, browser shows dialog with 2 options "Leave this page" and "Stay on this page".
I want automated test case to choose "Leave this page" option.
I use below code, however it does not seem to choose "Leave this page" and close the active browser.
OnBeforeUnloadDialog dialog = OnBeforeUnloadDialog.CreateOnBeforeUnloadDialog(ActiveBrowser, DialogButton.OK);
Could you please advice me how to handle this dialog and choose "Leave this page" to close the active browser?