I am testing a web based application and sometimes when the browser is closed it will throw a dialog to warn the visitor they are leaving the site without saving possible changes. This is all good and I've added some custom user code to the closebrowser recording to deal with the dialog. This code works fine on my local machine, also with Ranorex closed and just executing the .exe file but for some reason does not work on my CI Agent. It simply does not click the ButtonLeave and does not close the browser as the dialog is preventing this.
I've tried increasing the Duration in the Exists validation but this did nothing for me.
Code: Select all
public void Validate_Dialog(RepoItemInfo formInfo, RepoItemInfo buttonInfo)
{
if (repo.LeaveSite.DialogInfo.Exists(new Duration(4000))) {
Report.Log(ReportLevel.Info, "Validation", "Dialog does exist, so click leave.", formInfo);
repo.LeaveSite.ButtonLeave.Click();
}
else {
Report.Log(ReportLevel.Info, "Validation", "Dialog does NOT exist, browser closed", formInfo);
}
}
If any more information is required just let me know.