I'm working with Ranorex 8.0.1, and have the AutomationHelpers installed.
What i would like to achive is to have a Failure reported in case a certain Popup appears, but leave the test running. The two ways to achive that that i see is to somehow leverage the click-action to generate a failure-report (can't think of how though), or have a special UserCodeMethod "StartFailWatcher" that i can use instead of the usual "StartPopupWatcher" that i want to use for the other sorts of popups - what i have right now is this:
Code: Select all
[UserCodeMethod]
public static PopupWatcher StartFailWatcher(RepoItemInfo findElement, RepoItemInfo clickElement)
{
var key = findElement.GetMetaInfos()["id"] + clickElement.GetMetaInfos()["id"];
if (watchers.ContainsKey(key))
{
throw new ArgumentException("Popup watcher with given parameters already exists.");
}
var watcher = new PopupWatcher();
watcher.WatchAndClick(findElement, clickElement);
watcher.EnableReportMessages = true; // enables logging of this watcher
watcher.ReportCategory = "Failure"; // the logging is done as 'Failure' <-----------
watcher.Start();
watchers.Add(key, watcher);
Report.Info("Popup watcher started.");
return watcher;
}
any ideas how to achieve my goal? (Goal being to generate a Failure in the report, on triggering the PopupWatcher - whether with this UserCodeMethod or any other means, i don't care)