I have a requirement that i want to capture test report message as more as possible,e.g. i made serval test cases on a winform application.
The application would throws exception or show a error dialog dure the testcases running.When it throws a exception then it send the exception message to testcase executable file via .net romting client.If the testcase executable file receive the message then it appended the message to the report file,but if i use Report Class to log and append the message ,the report file was applied another xsl file,which it's content didn't including <activity> and it's style was not includes hierarchy and pie chart.Ok, then i try to use the TestReport,and the report file sytle was meet my requirement,the exception message which receive form the winfrom remoting client side was shown in the console ,but it was not append to the report file.
the code as follow:
public string ReportException(object message)
TestReport.EnableTracingScreenshots = false;
TestReport.ReportWriteInterval = 0;
using (new ActivityContext(new TestCaseActivity("STUDIOEXCEPTION","", "", "", 0, 0, null, "", null)))
using (new ActivityContext(new TestModuleActivity("testmodulename", "", "", ModuleType.UserCode)))
return message.ToString ();
Class library usage, coding and language questions.
2 posts • Page 1 of 1
Looks like you're missing Suit activity. And I find using TestReport.BeginTestSuite(),TestReport.BeginTestCase(), TestReport.BeginTestModule(),TestReport.EndTestModule(),TestReport.EndTestCase() a lot easier than activities.