PopupWatcher Report Level

Class library usage, coding and language questions.
STPJmassey
Posts: 3
Joined: Wed Jan 20, 2016 11:04 pm

PopupWatcher Report Level

Post by STPJmassey » Wed Feb 03, 2016 10:30 pm

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.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: PopupWatcher Report Level

Post by krstcs » Thu Feb 04, 2016 2:32 pm

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.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: PopupWatcher Report Level

Post by Support Team » Thu Feb 04, 2016 3:40 pm

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
.
Image

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: PopupWatcher Report Level

Post by krstcs » Thu Feb 04, 2016 3:59 pm

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.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: PopupWatcher Report Level

Post by Support Team » Thu Feb 04, 2016 4:31 pm

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
.
Image