XmlLogger.LogData produces no output

Bug reports.
hs.fk
Posts: 12
Joined: Thu Jul 12, 2012 11:47 am
Location: Hamburg

XmlLogger.LogData produces no output

Post by hs.fk » Thu Feb 14, 2013 2:17 pm

Hi,

I encountered a problem by using "Ranorex.Report.LogData" with "System.Drawing.Bitmap" and a attached "Ranorex.Core.XmlLogger".
The call to "XmlLogger.LogData" produces a NullPointerException,
because this line in "XmlLogger.LogData.SaveScreenshot" (same for "SaveSnapshot")
ReportEnvironment reportEnv = 
    ReportEnvironment.CreateFromViewFilename(logFileName, null);
should be
ReportEnvironment reportEnv = 
    ReportEnvironment.CreateFromViewFilename(logFileName, string.Empty);
(i think ;)

My test code:
string reportFileName = "Report.rxlog";
Report.Setup( ReportLevel.Debug, reportFileName, logToConsole: true );
Report.Start();

Report.SystemSummary();

Report.Info( "hi" );

var bmp = Imaging.CaptureDesktopImage( Host.Local );
Report.LogData( ReportLevel.Info, Report.DefaultCategory, bmp );
Report.Screenshot();

Report.Info( "bye" );

Report.End();
Console output:

Code: Select all

[2013/02/14 13:52:29.646][Debug  ][Logger]: Console logger starting.
[2013/02/14 13:52:29.974][Info   ][SystemSummary]: Host: EWIFK
Ranorex version: 4.0.2.21666
OS version: Windows XP Service Pack 3 32bit
OS default locale: de-DE
.NET Runtime version: 4.0.30319.296
Number of logical CPUs: 2
Number of displays: 1
Screen dimension: 1680x1050
Memory: 55% load, phy 900mb free/2046mb total, virt 1880mb free/2047mb total.

[2013/02/14 13:52:30.005][Info   ][User]: hi
[2013/02/14 13:52:32.802][Info   ][User]: Data logged: System.Drawing.Bitmap
[2013/02/14 13:52:32.896][Info   ][Screenshot]: Data logged: System.Drawing.Bitm
ap
[2013/02/14 13:52:32.911][Info   ][User]: bye
[2013/02/14 13:52:32.911][Debug  ][Logger]: Console logger stopping.
Report.rxlog content:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="RanorexReport.xsl"?>
<log title="Ranorex Test Report" rxversion="4.0.2.21666" osversion="Windows XP Service Pack 3 32bit" runtimeversion="4.0.30319.296" procarch="32bit">
<message time="2013/02/14 13:52:29.974" level="INFO" category="SystemSummary" style="" codefile="D:\Projekte\TestAutomation\SourceCode\_ConsoleApplication1\Program.cs" codeline="21">
<![CDATA[Host: EWIFK]]><br/>
<![CDATA[Ranorex version: 4.0.2.21666]]><br/>
<![CDATA[OS version: Windows XP Service Pack 3 32bit]]><br/>
<![CDATA[OS default locale: de-DE]]><br/>
<![CDATA[.NET Runtime version: 4.0.30319.296]]><br/>
<![CDATA[Number of logical CPUs: 2]]><br/>
<![CDATA[Number of displays: 1]]><br/>
<![CDATA[Screen dimension: 1680x1050]]><br/>
<![CDATA[Memory: 55% load, phy 900mb free/2046mb total, virt 1880mb free/2047mb total.]]><br/>
</message>
<message time="2013/02/14 13:52:30.005" level="INFO" category="User" style="" codefile="D:\Projekte\TestAutomation\SourceCode\_ConsoleApplication1\Program.cs" codeline="23">
<![CDATA[hi]]><br/>
</message>
<message time="2013/02/14 13:52:32.911" level="INFO" category="User" style="" codefile="D:\Projekte\TestAutomation\SourceCode\_ConsoleApplication1\Program.cs" codeline="29">
<![CDATA[bye]]><br/>
</message>
</log>

With best regrads,
fk


/e
formatting
(btw the "Please Read Before Posting"-post doesn't mention that you can use "
")

/e2
propably same issue Ranorex 4.0.2 screenshots not captured on errors

/e3
As a workaround I implemented a XmlLogger by myself.
It's based on Sourcecode from the "Ranorex.Core.XmlLogger", so i don't know if I'm allowed to post my version.

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

Re: XmlLogger.LogData produces no output

Post by Support Team » Fri Feb 15, 2013 11:23 am

Hi,

Thank you for your detailed post. This is a current bug in 4.0.2. We will fix this bug within the next version.

Regards,
Peter
Ranorex Team
.
Image

hs.fk
Posts: 12
Joined: Thu Jul 12, 2012 11:47 am
Location: Hamburg

Re: XmlLogger.LogData produces no output

Post by hs.fk » Fri Feb 15, 2013 12:31 pm

Hi,

thank you for the response.
Is there a public Bug-/Issue-Tracker available or is this subforum the only "place" for bugreports?

Regards,
fk

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

Re: XmlLogger.LogData produces no output

Post by Support Team » Fri Feb 15, 2013 12:53 pm

hs.fk wrote:Is there a public Bug-/Issue-Tracker available or is this subforum the only "place" for bugreports?
This subforum is the only place where you can report bugs.

Regards,
Peter
Ranorex Team
.
Image