Ranorex reporting from Visual Studio : Automation API

Ranorex reporting from Visual Studio

Class library usage, coding and language questions.

Ranorex reporting from Visual Studio

Postby anzacthecat » Wed Jan 25, 2012 1:48 pm

I am using Visual Studio to access the Ranorex API and my tests are running fine, but how do I use the Ranorex reporting tools?
anzacthecat
 
Posts: 29
Joined: Mon Jan 10, 2011 2:05 pm

Re: Ranorex reporting from Visual Studio

Postby Ciege » Wed Jan 25, 2012 5:27 pm

First you need to setup the report with something like this:
Code: Select all
Report.Setup(ReportLevel.Debug, LogFile, true);


If you also want to have the popup screen to appear about current test step while the testing is running you need to use something like the following:
Code: Select all
Ranorex.Core.Reporting.TestReport.Setup(ReportLevel.None, strTempReportDirectory + strDateTimeStamp + @"\" + "_DELETEME" + @"\_tempTestReport.rxlog", false);
Ranorex.Core.Reporting.TestReport.EnableTracingScreenshots = false;
Ranorex.Core.Reporting.TestReport.ReportWriteInterval = 0;
Ranorex.Controls.ProgressForm.Show();


Then, from your tests you can send info to the report using:
Code: Select all
Report.Success("Message.");
Report.Error("Message.");
Report.Failure("Message.");
Report.Debug("Message.");
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
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Ranorex reporting from Visual Studio

Postby anzacthecat » Fri Jan 27, 2012 11:51 am

Before I saw this I got it more or less working using something like:

TestReport.Setup(ReportLevel.Debug, "report.rxlog", true);
TestReport.BeginTestSuite("Testsuite");
TestReport.BeginTestModule("Testmodule");
TestReport.BeginTestCase("Testcase");
Report.info("Something to log");
TestReport.EndTestCase();
TestReport.EndTestModule();
TestReport.SaveReport();

This uses the new report functionality fine and puts in the titles of the testcase and testmodule but it's not adding the actual information, the "Something to log" bit. Am I missing something?
anzacthecat
 
Posts: 29
Joined: Mon Jan 10, 2011 2:05 pm

Re: Ranorex reporting from Visual Studio

Postby anzacthecat » Fri Jan 27, 2012 12:31 pm

Whoops, the answer is that Case and Module were the wrong way round. It should be:

TestReport.Setup(ReportLevel.Debug, "report.rxlog", true);
TestReport.BeginTestSuite("Testsuite");
TestReport.BeginTestCase("Testcase");
TestReport.BeginTestModule("Testmodule");

Report.info("Something to log");

TestReport.EndTestModule();
TestReport.EndTestCase();
TestReport.SaveReport();
anzacthecat
 
Posts: 29
Joined: Mon Jan 10, 2011 2:05 pm

Re: Ranorex reporting from Visual Studio

Postby artur_gadomski » Mon Mar 05, 2012 10:03 am

You got it. Important to remeber about the new style is that you only see messages if they are in TestModule and that you need to close Module /Case before starting new ones.
User avatar
artur_gadomski
 
Posts: 125
Joined: Mon Jul 19, 2010 7:55 am
Location: Copenhagen, Denmark


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests