Ranorex reporting from Visual Studio
-
- Posts: 31
- Joined: Mon Jan 10, 2011 1:05 pm
Ranorex reporting from Visual Studio
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?
Re: Ranorex reporting from Visual Studio
First you need to setup the report with something like this:
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:
Then, from your tests you can send info to the report using:
Code: Select all
Report.Setup(ReportLevel.Debug, LogFile, true);
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();
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...
Ciege...
-
- Posts: 31
- Joined: Mon Jan 10, 2011 1:05 pm
Re: Ranorex reporting from Visual Studio
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?
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?
-
- Posts: 31
- Joined: Mon Jan 10, 2011 1:05 pm
Re: Ranorex reporting from Visual Studio
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();
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();
- artur_gadomski
- Posts: 207
- Joined: Mon Jul 19, 2010 6:55 am
- Location: Copenhagen, Denmark
- Contact:
Re: Ranorex reporting from Visual Studio
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.