Page 1 of 1

PopupWatcher Report Level

Posted: Wed Feb 03, 2016 10:30 pm
by STPJmassey
I see that I can change the category of reports from PopupWatcher, but is there a way to change the level? Or some other way I can change the appearance in the report? For most popups, the default, innocuous style is fine, but there are some popups that we want to highlight and draw particular attention to if they occur.

Re: PopupWatcher Report Level

Posted: Thu Feb 04, 2016 2:32 pm
by krstcs
Report.Info(...) <- Normal
Report.Error(...) <- Error (red background) without test failure
Report.Failure(...) <- Failure (red background) WITH test failure
Report.Warn(...) <- Warning (yellow background) with warning symbols at report tree branch heads


You can look at the API (http://www.ranorex.com/Documentation/Ranorex/) for more information.

Re: PopupWatcher Report Level

Posted: Thu Feb 04, 2016 3:40 pm
by Support Team
Hello STPJmassey,

Unfortunately, there is no option to change the report level of Popup Watcher messages. If needed, you could change the background color of such log messages using the following code. For example, this code could be executed when initializing the Popup Watcher.

Code: Select all

PopupWatcher myPopupWatcher = new PopupWatcher();  
Report.CustomCategoryStyles[myPopupWatcher.ReportCategory]= "background-color: #FFFF3D";
Please note that this method is part of our internal API. We do not guarantee for any side-effects and we preserve the right to change our internal methods at any time.

Sincerely,
Johannes

Re: PopupWatcher Report Level

Posted: Thu Feb 04, 2016 3:59 pm
by krstcs
Johannes, if you have the Report levels as I showed, it will add a report entry in that color when the PopupWatcher is run. I do this right now with my watchers, if they are for an error dialog.

The caveat here is that the PopupWatchers report entries may not be where you expect them and may make the report look like another test case failed. If you do a thorough inspection of the information in the report and you have your report info being logged correctly for the PopupWatcher, this shouldn't be a problem.

Re: PopupWatcher Report Level

Posted: Thu Feb 04, 2016 4:31 pm
by Support Team
Hello krstcs,

Yes, of course it would also be a good approach to log custom messages to the report. Note that this doesn't change the report level of the default Popup Watcher log messages.

If a custom message is logged to the report, the default logging mechanism might be redundant.
Therefore, the report messages of the Popup Watcher could be disabled with the following code:

Code: Select all

myPopupWatcher.EnableReportMessages=false;
Sincerely,
Johannes