'Duration' in Ranorex Report : General Questions

'Duration' in Ranorex Report

Ask general questions here.

'Duration' in Ranorex Report

Postby artur_gadomski » Tue Jun 28, 2011 8:52 am

Hi
In ranorex report in 'system information' part there is an item called 'duration'. How does one make it work when writing tests in VS2010? It always shows 0ms for me.
User avatar
artur_gadomski
 
Posts: 125
Joined: Mon Jul 19, 2010 7:55 am
Location: Copenhagen, Denmark

Re: 'Duration' in Ranorex Report

Postby Support Team » Tue Jun 28, 2011 3:42 pm

Hi,
artur_gadomski wrote:In ranorex report in 'system information' part there is an item called 'duration'. How does one make it work when writing tests in VS2010? It always shows 0ms for me.

If you use a Ranorex Test Suite file, then this duration will be set automatically, because this property depends on how long the test suite run. So you have to use a rxtst file or you could use one of following solutions posted by our forum users:
how-to-measure-the-performance-of-actions-t1682.html
capturing-click-timings-t2299.html

Regards,
Peter
Ranorex Team
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: 'Duration' in Ranorex Report

Postby artur_gadomski » Tue Jun 28, 2011 4:15 pm

My code looks like this:
Ranorex.Controls.ProgressForm.Show();
            
TestReport.Setup(ReportLevel.Debug, pathToReport, true);
TestReport.BeginTestSuite("suite");

//my code including 
TestReport.BeginTestModule("Uninstall");
//and
TestReport.EndTestModule();

TestReport.SaveReport(); 
Report.End();


And even if I was to count the time myself, could I put it in this 'duration'?
btw time is properly counted and reported for test modules.
User avatar
artur_gadomski
 
Posts: 125
Joined: Mon Jul 19, 2010 7:55 am
Location: Copenhagen, Denmark

Re: 'Duration' in Ranorex Report

Postby Support Team » Tue Jun 28, 2011 11:31 pm

Hello,

the reporting of duration is part of the activity stack that is created while a test suite is run.
You would have to use that. Here is a sample:
TestReport.Setup(ReportLevel.Info, filename, false);
using (new ActivityContext(new TestSuiteActivity("test suite report header")))
{
    using (new ActivityContext(new TestCaseActivity(("test case name"))))
    {
        using (new ActivityContext(new TestModuleActivity("test module name")))
        {
            Report.Error("error message");
            Report.Info("infor message");
        }
    }
}
TestReport.SaveReport();
Report.End();


Regards,
Roland
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: 'Duration' in Ranorex Report

Postby artur_gadomski » Wed Jun 29, 2011 9:04 am

I'd rather stay away from this using activity context, that's why I really like the startTestModule/Case and EndTestModule/Case methods. Why is there no EndTestSuite method?
User avatar
artur_gadomski
 
Posts: 125
Joined: Mon Jul 19, 2010 7:55 am
Location: Copenhagen, Denmark

Re: 'Duration' in Ranorex Report

Postby Support Team » Wed Jun 29, 2011 8:12 pm

Hello,

sure, ActivityContext is just an IDisposable to allow using syntax. It does the same as BeginTest{Suite,Module,Case}/End{Module,Case}. EndTestSuite is not there, because it corresponds to the end of the report, and that you do when you do SaveReport().

Regards,
Roland
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to General Questions

Who is online

Users browsing this forum: No registered users and 0 guests