Page 1 of 1

report parser

Posted: Fri Apr 24, 2009 11:53 am
by SQA-SQA
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 ?

Posted: Fri Apr 24, 2009 12:36 pm
by SQA-SQA
nevermind my question, I found some workaround.
(renaming the rxlog to xml does the job :) )

Posted: Fri Apr 24, 2009 9:10 pm
by Ciege
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);

Posted: Mon Apr 27, 2009 9:40 am
by SQA-SQA
thanks ciege !

Re: report parser

Posted: Thu Dec 17, 2009 6:24 pm
by ohm
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.

Re: report parser

Posted: Thu Dec 17, 2009 6:30 pm
by Ciege
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);

Re: report parser

Posted: Thu Dec 17, 2009 7:30 pm
by ohm
Thank you so much Ciege.
It works perfectly. Exactly what I was looking for. I really appreciate it.

Re: report parser

Posted: Mon Jan 03, 2011 11:53 am
by SanMan
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 ?

Re: report parser

Posted: Mon Jan 03, 2011 3:00 pm
by Support Team
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

Re: report parser

Posted: Tue Jan 04, 2011 8:50 am
by SanMan
Excellent! Works very well. Thank you!