How to get the result of a TestSuite by code

Class library usage, coding and language questions.
Ch_Ef
Posts: 10
Joined: Thu Nov 11, 2010 7:37 am

How to get the result of a TestSuite by code

Post by Ch_Ef » Tue Jun 30, 2015 9:15 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Wed Jul 01, 2015 8:47 am

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
.
Image

Ch_Ef
Posts: 10
Joined: Thu Nov 11, 2010 7:37 am

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

Post by Ch_Ef » Wed Jul 01, 2015 9:21 am

Hi Robert,
thanks for your answer. Everything works fine.

Regards,
Christian