report appending in 2.2

Ask general questions here.
Ruser
Posts: 24
Joined: Wed Oct 07, 2009 3:26 pm

report appending in 2.2

Post by Ruser » Wed Nov 18, 2009 9:37 pm

In the 2.2 release note, there is:

"The XML Report Logger now supports appending to existing files, custom XSL files and HTML markup logging"

Do you have any user guide on this? What I want to do is to put multiple reports into a single report file.

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: report appending in 2.2

Post by atom » Thu Nov 19, 2009 8:08 pm

Hiya

I agree some documentation on this is needed

Regards

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

Re: report appending in 2.2

Post by Support Team » Fri Nov 20, 2009 11:15 am

Documentation for this and other parts is currently under construction :)

"The XML Report Logger now supports appending to existing files, custom XSL files and HTML markup logging"

Here is the short version:

1) To append to XML logs use XmlLogger.AppendExisting = true
2) Custom XSL: use XmlLogger.SetReportStyleSheet (or SetReportStyleSheetFile)
3) To log HTML tags use Report.LogHtml(level, htmlText)

1&2 need to be called before Report.Setup()

Michael
Ranorex Team

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: report appending in 2.2

Post by atom » Fri Nov 20, 2009 8:02 pm

ok thanks

I see the ranorex XSL is using a CSS that is coming from your website
If I modify the XSL, Im ok to reference the same CSS ?

Also there is:

<log title="Ranorex Test Report">

can that be customised also? e.g. "MyCompany Test Report"!

(Sorry to remove your good name and logo!)

Ruser
Posts: 24
Joined: Wed Oct 07, 2009 3:26 pm

Re: report appending in 2.2

Post by Ruser » Mon Nov 23, 2009 4:52 pm

Thanks for the information.

I am still not quite sure what to do If I have multiple solutions to run and would like to generate only one report file. I guess this scirpt:

XmlLogger.AppendExisting = true

appends the report to the existing report file inside the solution.

For me, this one only works if I run the same solution multiple times and generate one report file, right?

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

Re: report appending in 2.2

Post by Support Team » Wed Nov 25, 2009 10:37 am

atom wrote:I see the ranorex XSL is using a CSS that is coming from your website
If I modify the XSL, Im ok to reference the same CSS ?
Yes, feel free to use the CSS from our homepage.
atom wrote:Also there is:
<log title="Ranorex Test Report">
can that be customised also? e.g. "MyCompany Test Report"!
If you create your own XSL, you can customize everything. For example, just don't use the title in the <log> tag, but a hard-coded one in your XSL.
Ruser wrote:XmlLogger.AppendExisting = true
appends the report to the existing report file inside the solution.

For me, this one only works if I run the same solution multiple times and generate one report file, right?
XmlLogger.AppendExisting = true only applies if you specify an existing log file in Report.Setup.

Regards,
Alex
Ranorex Support Team

User avatar
Gunner1980
Posts: 89
Joined: Mon Apr 05, 2010 8:44 pm
Location: Austin, Texas

Re: report appending in 2.2

Post by Gunner1980 » Thu May 13, 2010 9:12 pm

Any update on this documentation? I have been pulling my hair out over this for several weeks now.

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

Re: report appending in 2.2

Post by Support Team » Fri May 14, 2010 8:03 am

Gunner1980 wrote:Any update on this documentation? I have been pulling my hair out over this for several weeks now.
The Ranorex User Guide contains documentation for this feature, please see the following topic:
http://www.ranorex.com/support/user-gui ... html#c2681

The corresponding API documentation for that class was also extended:
http://www.ranorex.com/Documentation/Ra ... Report.htm
http://www.ranorex.com/Documentation/Ra ... etup_1.htm

Regards,
Alex
Ranorex Team

User avatar
DirkB
Posts: 19
Joined: Thu Jan 29, 2009 9:53 am

Re: report appending in 2.2

Post by DirkB » Fri May 14, 2010 5:01 pm

Hi,

I try do to custimize the reports too:
1. another logo
2. Insertion of line numbers

SetReportStylesheetFile accesses my modified xls - ok
But:
1. Changes title=Ranorex doesnt appear within report
2. I didn't find the mentioned tag <log title="...

Regards
Dirk

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

Re: report appending in 2.2

Post by Support Team » Mon May 17, 2010 10:57 am

Hi Dirk,

I just checked and you are right, the title cannot be changed without modifying the XML file :(
I have added a feature request for V2.3.2 (something like XmlLogger.Title = "My Company Report")

Also, we have major improvements planned for V3.0 Reporting, so if there are any suggestions or wishes this is the right location to post them :D

Michael
Ranorex Team

User avatar
Gunner1980
Posts: 89
Joined: Mon Apr 05, 2010 8:44 pm
Location: Austin, Texas

Re: report appending in 2.2

Post by Gunner1980 » Mon May 17, 2010 5:39 pm

Additionally I would suggest a way to not need access to the internet. I am running in a closed environment where my test systems will not have access to the internet which defaults the style sheet back to something basic. I have tried downloading the style sheets locally and changing the path in the xsl file but I can't seem to get it to read it in without using an absolute path.

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: report appending in 2.2

Post by Ciege » Mon May 17, 2010 6:31 pm

Support Team wrote:Also, we have major improvements planned for V3.0 Reporting, so if there are any suggestions or wishes this is the right location to post them :D
Couple of things I would like to see in reporting.
1) The ability to add a global Pass/Fail/Warning to the top of the report based on any failures or warnings in the entire log.
2) To add to #1 the ability to add number of pass/fail/warnings to the top and/or bottom of the log.
3) A way to group test results. In other words instead of a flat report add the ability to add group headers so that when you first review the report you can drill down or expand (with a plus/minus box) the test sections within the overall report.
4) To add to #3 allow the group headers to show a pass fail for the group when the group is collapsed.
5) An easy way to add different/more color schemes to the report based on different categories.

Sure I can come up with more but that was off the top of my head.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
DirkB
Posts: 19
Joined: Thu Jan 29, 2009 9:53 am

Re: report appending in 2.2

Post by DirkB » Tue May 18, 2010 9:03 am

Hi Michael,

I found an report item (table) that is successfully controlled by the xsl File :D :
</fieldset>
<table border="0" cellspacing="0" width="100%">
<tr>
<th width="15%" >
<b>Line</b>
</th>
<th width="15%" >
<b>Time</b>
</th>
<th width="10%" >
<b>Level</b>
</th>
...
<xsl:apply-templates select="//message"/>
</table>
So I extended the xsl with a column "Line" Number.
But how can I fill this new column?
Probably within Report.Setup ?
By now Line will be filled with Time, Time will be filled with Level, Level will be filled with...

Best regards
Dirk

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

Re: report appending in 2.2

Post by Support Team » Tue May 18, 2010 10:42 am

Hi guys,

Thanks for the suggestions.

@Gunner: I attached a custom offline stylesheet; this does not use any http:// urls (so styles and images are local)

@Ciege: 1) to 4) are already, more or less, in our pipeline, so the new reports will have a (collapsible) tree structure and some kind of global summary (e.g. pass/fail/skip/block). The color schemes are a good idea; so basically you should be able to add a custom color mapping for given category name, right ?

@Dirk: Unfortunately, to do this, you need to jump through some hoops and do something like this:

Use
Report.LogHtml(..., BuildMsg("Your regular message", GetLine()))

with

string BuildMsg(string msg, string line)
{
    return "<![CDATA["+msg+"]]>"+"<linenumber value=\""+line+"\"/>";
}

string GetLine()
{
	StackFrame sf = new StackTrace(true).GetFrame(1);
	return sf.GetFileName()+":"+sf.GetFileLineNumber();
}
and in the stylesheet, add a value selector for your new column:

Code: Select all

 <td>
      <xsl:value-of select ="./linenumber/@value"/>
 </td>
You can add other custom information this way.

Cheers,
Michael
Ranorex Team
You do not have the required permissions to view the files attached to this post.

User avatar
DirkB
Posts: 19
Joined: Thu Jan 29, 2009 9:53 am

Re: report appending in 2.2

Post by DirkB » Tue May 18, 2010 1:23 pm

Hi Michael,

thanx a lot - it works!
A new column "linenumber" has been filled now.
So we can customize the report table extensively.

Best regards
Dirk