Ranorex Report filters sorted by messages order.

Bug reports.
User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Ranorex Report filters sorted by messages order.

Post by artur_gadomski » Thu Jul 28, 2011 11:09 am

Hi
It seems like the filter of messages in test module is sorted according to what message comes first so if I have an info message first in the module then some debug then a sucess order of filters will be different than if I have a debug message first.
Is this something I can specify? I would preffer if the order was always the same because it's easier to turn of debug messages without having to look for the checkbox.

On a sidenote: is it possible to make a report with debug level disabled by default? I still want the messages to be logged and have an ability to see them so seting minimum level to info will not work for me.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex Report filters sorted by messages order.

Post by Support Team » Fri Jul 29, 2011 10:45 am

Hi,
artur_gadomski wrote: I would preffer if the order was always the same because it's easier to turn of debug messages without having to look for the checkbox.
You are right, currently the order depends on which message is logged first.
We will change this to the order of the report level. We will use the same order as in the recorder action report
artur_gadomski wrote: is it possible to make a report with debug level disabled by default? I still want the messages to be logged and have an ability to see them so seting minimum level to info will not work for me.
You have to edit the xsl file. There you can set the checked states.

Regards,
Peter
Ranorex Team

Pavlo
Posts: 43
Joined: Fri Dec 30, 2011 10:55 am

Re: Ranorex Report filters sorted by messages order.

Post by Pavlo » Wed Apr 18, 2012 1:38 pm

Hi

Can you please help me modifying xsl file?
How can I set default checked state to 'un-checked' to Debug checkbox?

-re
Pavlo

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex Report filters sorted by messages order.

Post by Support Team » Fri Apr 20, 2012 10:00 am

Hi,
Pavlo wrote:Can you please help me modifying xsl file?
We currently have a bug in the XSL file which will be fixed in Ranorex 3.3, therefore this is not possible at the moment. I cannot send you the Ranorex 3.3 file because it is a bit different to the 3.2 XSL file.

Regards,
Peter
Ranorex Team

Pavlo
Posts: 43
Joined: Fri Dec 30, 2011 10:55 am

Re: Ranorex Report filters sorted by messages order.

Post by Pavlo » Thu Jun 28, 2012 8:12 am

Support Team wrote:Hi,
Pavlo wrote:Can you please help me modifying xsl file?
We currently have a bug in the XSL file which will be fixed in Ranorex 3.3, therefore this is not possible at the moment. I cannot send you the Ranorex 3.3 file because it is a bit different to the 3.2 XSL file.

Regards,
Peter
Ranorex Team
Can I ask for help again, when Ranorex 3.3 is released :)

Regards,
Pavlo

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex Report filters sorted by messages order.

Post by Support Team » Fri Jun 29, 2012 9:50 am

Hello Pavlo,

The order of the check boxes in the report is fix (Debug, Info, Warn, Error, Success, Failure, Custom). If there is e.g. no error in your test the check box for Error will not be shown.
If you want that the Debug messages will not be shown in the Report you can change the Log Level settings in the Test Suite properties.
Ranorex 3.3 is already released.

Regards,
Bernhard
Ranorex Support Team

Pavlo
Posts: 43
Joined: Fri Dec 30, 2011 10:55 am

Re: Ranorex Report filters sorted by messages order.

Post by Pavlo » Mon Jul 30, 2012 12:14 pm

Hi

Actually I'm looking on how to still have debug messages logged by not displayed by default in report.
E.g. minimum level = DEBUG, but in report xml checkbox with debug level is un-ticked by default and debug messages are not displayed (but could be easily checked by ticking that checkbox)
artur_gadomski wrote: is it possible to make a report with debug level disabled by default? I still want the messages to be logged and have an ability to see them so seting minimum level to info will not work for me.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex Report filters sorted by messages order.

Post by Support Team » Tue Jul 31, 2012 10:48 am

Hi,

My colleague and I wrote a few new codelines for the .xsl file and voila the result gives you a report with un-ticked and hidden debug-messages.
These lines are the one which did the trick:
<xsl:variable name="RXStyle" >
	<xsl:choose>
		<xsl:when test="@level!='Debug'">
			<xsl:value-of select="@style" />
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="'display:none'" />
		</xsl:otherwise>
	</xsl:choose>
	</xsl:variable>
	
	<tr class="{translate(@level,' ','_')}" style="{$RXStyle}" onMouseOver="DisplayHoverMenu(this)"  onMouseOut="HideHoverMenu(this)">
The first code-snipped is for hiding the debug-messages for now.

The second is for un-ticking the "Debug" checkbox by default.
<xsl:choose>
    <xsl:when test="$level/../../activity[@type='test module']">
	  <xsl:choose>
		<xsl:when test="$levelName!='Debug'">
		  <input type="checkbox" id="checkBox{$currentId}" name="checkBox{$currentId}" onClick="$(this).parent().parent().next().find('tr.{translate($levelName,' ','_')}').toggle();"  checked="1" />
		</xsl:when>
		<xsl:otherwise>
		  <input type="checkbox" id="checkBox{$currentId}" name="checkBox{$currentId}" onClick="$(this).parent().parent().next().find('tr.{translate($levelName,' ','_')}').toggle();" />
		</xsl:otherwise>
	  </xsl:choose>
    </xsl:when>
    <xsl:otherwise>
      <input type="checkbox" id="checkBox{$currentId}" name="checkBox{$currentId}" onClick="$('tr.{translate($levelName,' ','_')}').toggle();"  />	  
    </xsl:otherwise>
  </xsl:choose>
You can copy this modified code into your .xsl file or you copy the whole modified .xsl stylesheet from the attachment into your Report folder. In the .xsl file from the attachment another line of code needs to be modified, namely the one where the .xsl file is called recursively.
ss.load("MODIFIED_RanorexReport3.xsl");
To tell Ranorex to use this stylesheet instead of the default RanorexReport3.xsl open your Ranorex, go to the TestSuit properties (see Test Suite Settings) and choose as Custom XSL File path the one of the modified stylesheet.

Wish you a lot of fun with this.
Larissa
Ranorex Support Team
You do not have the required permissions to view the files attached to this post.

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Ranorex Report filters sorted by messages order.

Post by artur_gadomski » Wed Aug 01, 2012 10:01 am

This is brilliant. Exactly what we needed.
I think attachement is missing.

To make it a bit more clear I replaced line in stylesheet:
<tr class="{@level}" style="{@style}" onMouseOver="DisplayHoverMenu(this)"  onMouseOut="HideHoverMenu(this)">
with first code.
And lines:
<xsl:choose>
    <xsl:when test="$level/../../activity[@type='test module']">
      <input type="checkbox" id="checkBox{$currentId}" name="checkBox{$currentId}" onClick="$(this).parent().parent().next().find('tr.{$levelName}').toggle();" checked="1" />
    </xsl:when>
    <xsl:otherwise>
      <input type="checkbox" id="checkBox{$currentId}" name="checkBox{$currentId}" onClick="$('tr.{$levelName}').toggle();" checked="1" />
    </xsl:otherwise>
  </xsl:choose>
with second code.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex Report filters sorted by messages order.

Post by Support Team » Wed Aug 01, 2012 10:30 am

Hi,

Yeah you are right, sorry for that. I now attached it to my original post.

Regards,
Larissa
Ranorex Support Team

Pavlo
Posts: 43
Joined: Fri Dec 30, 2011 10:55 am

Re: Ranorex Report filters sorted by messages order.

Post by Pavlo » Tue Jun 18, 2013 11:02 am

Hi

Can you please advise how to use custom xsl file if I'm not using TestSuites.

I'm setting up reports manually with following piece of code

Code: Select all

TestReport.Setup(ReportLevel.Debug, reportFileName, true, true, new Duration(1000));
And I can't find any tip in Ranorex documentation and forum how to use custom xsl file :(

I've already tried to use, but it didn't help: custom xsl is not used (but generic xsl file still used)

Code: Select all

string reportFileName = Path.Combine(reportFolder, fixtureName+"Results.html");
string customXSLFile = Config.RootPath + "3rdParty\\RanorexReport4_DEBUG_disabled.xsl";
XmlLogger.SetReportStylesheetFile(customXSLFile);
TestReport.Setup(ReportLevel.Debug, reportFileName, true, true, new Duration(1000));

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex Report filters sorted by messages order.

Post by Support Team » Wed Jun 19, 2013 3:20 pm

Hello,

Unfortunately it is not possible to mix the XMLLogger class with the TestReport class.
If you want to use a custom report template you have to pass the file location where your custom report is located as parameter.
public static void Setup(
	ReportLevel minLevel,
	string fileName,
	bool logToConsole,
	string customReportFileLocation
)
Please take a look into the API Documentation on our web site.
Please let me know if you need more information or assistance.
Thank you!

Regards,
Bernhard

Pavlo
Posts: 43
Joined: Fri Dec 30, 2011 10:55 am

Re: Ranorex Report filters sorted by messages order.

Post by Pavlo » Wed Jun 19, 2013 3:59 pm

I've tried that, but got exception

Code:

Code: Select all

string customXSLFile = Config.RootPath + "3rdParty\\RanorexReport4_DEBUG_disabled.xsl";
TestReport.Setup(ReportLevel.Debug, reportFileName, true, true, new Duration(1000), customXSLFile);
Exception details:

Code: Select all

System.IO.DirectoryNotFoundException: The custom report template directory '...my path...3rdParty\RanorexReport4_DEBUG_disabled.xsl' does not exist.   at Ranorex.Core.Reporting.ReportEnvironment.Create(String r...
Since exception details says: DirectoryNotFoundException, I've modified the code and pass directory path but not full name for xsl file.

Code:

Code: Select all

string customXSLFile = Config.RootPath + "3rdParty\\RanorexReport4_DEBUG_disabled.xsl";
string customXSLFolder = Path.GetDirectoryName(customXSLFile);
TestReport.Setup(ReportLevel.Debug, reportFileName, true, true, new Duration(1000), customXSLFolder);
New exception:

Code: Select all

System.IO.FileNotFoundException: Report template does not contain a *.rxlog view file.   at Ranorex.Core.Reporting.ReportEnvironment.ValidateCustomReportDirectory()   at Ranorex.Core.Reporting.ReportEnvironment..ctor(String reportViewName, String reportFil...

Can you please clarify what is "Report template" and why should I have *.rxlog file and what should be inside this file?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex Report filters sorted by messages order.

Post by Support Team » Fri Jun 21, 2013 1:47 pm

Hello,

Thank you for providing the error messages.

Code: Select all

System.IO.DirectoryNotFoundException: The custom report template directory '...my path...3rdParty\RanorexReport4_DEBUG_disabled.xsl' does not exist.   at Ranorex.Core.Reporting.ReportEnvironment.Create(String r...
This message means that it is not possible to pass the path to the .xsl file directly in the TestReport.Setup() method. You can only define the directory from the test report as you did in your second code example.

Code: Select all

System.IO.FileNotFoundException: Report template does not contain a *.rxlog view file.   at Ranorex.Core.Reporting.ReportEnvironment.ValidateCustomReportDirectory()   at Ranorex.Core.Reporting.ReportEnvironment..ctor(String reportViewName, String reportFil...
In general the Report Template consist of the following files:
  • - customStyle.css
    - RanorexReport4.png
    - RanorexReport4.xsl
    - View.rxlog
Please make sure that all files listed above are available in the custom report directory.

Regards,
Bernhard

Pavlo
Posts: 43
Joined: Fri Dec 30, 2011 10:55 am

Re: Ranorex Report filters sorted by messages order.

Post by Pavlo » Fri Jun 21, 2013 1:52 pm

What is View.rxlog ? Where should I take this file? What should be it's content?