Page 1 of 1

How to get the result of a TestSuite by code

Posted: Tue Jun 30, 2015 9:15 am
by Ch_Ef
Good morning,

Refering to the examples
http://www.ranorex.com/forum/post15640.html#p15640 and
http://www.ranorex.com/forum/force-test ... t4520.html
i want to find out, if there is a way to get the result of a TestSuite by code.
TestReport.Setup(<ReportLevel>, <ReportName>, true);
TestReport.BeginTestSuite("TestSuite");
TestReport.BeginTestCase("TestCase");
TestReport.BeginTestModule("TestModule");

// a Report.Success / Failure / Error ... made here 
// leads to an adaption of the result generated 
// within the report, saved as defined in Setup-call above

TestReport.EndTestModule();
TestReport.EndTestCase();
TestReport.SaveReport();
Is it possible to get the result of the TestSuite, mentioned in the code-comment by code?

Regards,
Christian

Re: How to get the result of a TestSuite by code

Posted: Wed Jul 01, 2015 8:47 am
by Support Team
Hello Christian,

The status of the current test suite activity can be accessed by using the following code:

Code: Select all

 var status = TestReport.CurrentTestSuiteActivity.Status;
Regards,
Robert

Re: How to get the result of a TestSuite by code

Posted: Wed Jul 01, 2015 9:21 am
by Ch_Ef
Hi Robert,
thanks for your answer. Everything works fine.

Regards,
Christian