Page 1 of 2

Ranorex Report filters sorted by messages order.

Posted: Thu Jul 28, 2011 11:09 am
by artur_gadomski
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.

Re: Ranorex Report filters sorted by messages order.

Posted: Fri Jul 29, 2011 10:45 am
by Support Team
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

Re: Ranorex Report filters sorted by messages order.

Posted: Wed Apr 18, 2012 1:38 pm
by Pavlo
Hi

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

-re
Pavlo

Re: Ranorex Report filters sorted by messages order.

Posted: Fri Apr 20, 2012 10:00 am
by Support Team
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

Re: Ranorex Report filters sorted by messages order.

Posted: Thu Jun 28, 2012 8:12 am
by Pavlo
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

Re: Ranorex Report filters sorted by messages order.

Posted: Fri Jun 29, 2012 9:50 am
by Support Team
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

Re: Ranorex Report filters sorted by messages order.

Posted: Mon Jul 30, 2012 12:14 pm
by Pavlo
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.

Re: Ranorex Report filters sorted by messages order.

Posted: Tue Jul 31, 2012 10:48 am
by Support Team
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

Re: Ranorex Report filters sorted by messages order.

Posted: Wed Aug 01, 2012 10:01 am
by artur_gadomski
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.

Re: Ranorex Report filters sorted by messages order.

Posted: Wed Aug 01, 2012 10:30 am
by Support Team
Hi,

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

Regards,
Larissa
Ranorex Support Team

Re: Ranorex Report filters sorted by messages order.

Posted: Tue Jun 18, 2013 11:02 am
by Pavlo
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));

Re: Ranorex Report filters sorted by messages order.

Posted: Wed Jun 19, 2013 3:20 pm
by Support Team
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

Re: Ranorex Report filters sorted by messages order.

Posted: Wed Jun 19, 2013 3:59 pm
by Pavlo
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?

Re: Ranorex Report filters sorted by messages order.

Posted: Fri Jun 21, 2013 1:47 pm
by Support Team
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

Re: Ranorex Report filters sorted by messages order.

Posted: Fri Jun 21, 2013 1:52 pm
by Pavlo
What is View.rxlog ? Where should I take this file? What should be it's content?