Create Test Case from code Module

Ask general questions here.
skhanpara
Posts: 94
Joined: Wed Apr 23, 2014 3:55 pm

Create Test Case from code Module

Post by skhanpara » Tue May 13, 2014 3:35 pm

I wrote a function for testing policies which has similar steps and its working fine
Is there anyway i can give heading to my individual test run

when we create a new Test case in test suite.it gets a heading in report

similar stuff i want to do in code module

is it possible???

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

Re: Create Test Case from code Module

Post by Support Team » Wed May 14, 2014 3:35 pm

Hi,

When I got the question correctly you want to create your own report structure in code, right?
If so, this can be handled by using the methods of the TestReport class.
Here is a small sample about how you can create a test case with a module in code:
TestReport.Setup(ReportLevel.Debug, "MyReport.rxlog", true);
TestReport.BeginTestSuite("My TestSuit");
TestReport.BeginTestCase("My TestCase");
TestReport.BeginTestModule("My Test Module");
...
// Your actions can come here
...
TestReport.EndTestModule();
TestReport.EndTestCase();
TestReport.SaveReport();
For more information about the TestReport class please see: TestReport Class.

Regards,
Markus
.
Image