report parser

Ask general questions here.
SQA-SQA
Posts: 7
Joined: Thu Apr 16, 2009 2:05 pm

report parser

Post by SQA-SQA » Fri Apr 24, 2009 11:53 am

hi,
currently the testcase result is reported as an rxlog-file.

I want to parse each log file, collect those results and wrap it up in a global report. However, the rxlog is no plain logfile, it uses internally javascripts ? ( if I open an rxlog, i do not see any validation checkings etc etc

How can i easely create a full parseable XML log that doesn't requires ranorex.reportviewer.exe to open it to be fully readable ?

SQA-SQA
Posts: 7
Joined: Thu Apr 16, 2009 2:05 pm

Post by SQA-SQA » Fri Apr 24, 2009 12:36 pm

nevermind my question, I found some workaround.
(renaming the rxlog to xml does the job :) )

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

Post by Ciege » Fri Apr 24, 2009 9:10 pm

This might help you, or not... But,

I use the Report.Setup method and actually name my report with a .XML extension so I do not have to go through the extra step of renaming it to .XML later.

Code: Select all

// Setup Reporter   
string LogFile = @"c:\temp\Report\H$InstallTestLog.xml";

if (Directory.Exists(@"c:\temp\Report") == false)
{
    Directory.CreateDirectory(@"c:\temp\Report");
}

Report.Setup(ReportLevel.Debug, LogFile, true);

SQA-SQA
Posts: 7
Joined: Thu Apr 16, 2009 2:05 pm

Post by SQA-SQA » Mon Apr 27, 2009 9:40 am

thanks ciege !

ohm
Posts: 27
Joined: Thu Dec 03, 2009 7:27 pm

Re: report parser

Post by ohm » Thu Dec 17, 2009 6:24 pm

It works.
Thanks Ciege.

I have it like this:

Code: Select all

string LogfileName = @"c:\Reports\Folder1\TestReport.xml";
If Folder1 doesn't exist, it gets created.

Is there anyway I can change this Folder1 to DateTime format or something like that. So every time it will create a Folder containing date and time and reports will be saved inside that folder.

Thanks.

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

Re: report parser

Post by Ciege » Thu Dec 17, 2009 6:30 pm

ohm wrote: Is there anyway I can change this Folder1 to DateTime format or something like that. So every time it will create a Folder containing date and time and reports will be saved inside that folder.
Sure, if you write a little code to generate a date time stamp as a sting value you can just replace folder1 with that.

Something like this should suffice:

Code: Select all

            string strYear = System.DateTime.Now.Year.ToString();
            string strMonth = System.DateTime.Now.Month.ToString();
            string strDay = System.DateTime.Now.Day.ToString();
            string strHour = System.DateTime.Now.Hour.ToString();
            string strMinute = System.DateTime.Now.Minute.ToString();
            string strSecond = System.DateTime.Now.Second.ToString();
            string strDateTimeStamp = strYear + "_" + strMonth + "_" + strDay + "___" + strHour + "_" + strMinute + "_" + strSecond;
            string LogFile = @"c:\temp\Report\" + strDateTimeStamp + @"\MyReportName.xml";
            Report.Setup(ReportLevel.Debug, LogFile, true);
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...

ohm
Posts: 27
Joined: Thu Dec 03, 2009 7:27 pm

Re: report parser

Post by ohm » Thu Dec 17, 2009 7:30 pm

Thank you so much Ciege.
It works perfectly. Exactly what I was looking for. I really appreciate it.

SanMan
Posts: 147
Joined: Tue Apr 13, 2010 9:59 am

Re: report parser

Post by SanMan » Mon Jan 03, 2011 11:53 am

When I have renamed my *.rxlog to *.XML, it opens to Internet Explorer (as it should do)

But should the buttons (Log Level) in my report also work ?

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

Re: report parser

Post by Support Team » Mon Jan 03, 2011 3:00 pm

Hi SanMan,
there's no difference between opening the ranorex log file in Report Viewer and in IE, so clicking on the report level check boxes should work fine. Have you allowed 'blocked content' (on top of the IE view) for the report '.xml' file?

Best regards,
Christian
Ranorex Team
.
Image

SanMan
Posts: 147
Joined: Tue Apr 13, 2010 9:59 am

Re: report parser

Post by SanMan » Tue Jan 04, 2011 8:50 am

Excellent! Works very well. Thank you!