i'm quite new to ranorex, so sorry if that question is too trivial.
I'm trying to use the EmailModule from the RanorexAutomationHelpers. Basically it works fine, as long as I only run a single TestSuite but not the whole solution. If a run the whole solution (currently 3 Testsuites each containing 1-3 Tests and a call to the mail module in the teardown), the variables seem to get mixed up (number of successful testcases, number of failed testcases, error count and and filename are wrong in the mail.
Or is the mail module intended to be used with a single testsuite only?
Do i need to wait some time to let ranorex finish everything before calling the mailmodule? (currently it's the only action taken in teardown beside closing the AUT)
EDIT: i have no data-binding so far, so all the variables are unbound. Though, the variables not working, are those defined at the beginning of the code from the "TestReport.CurrentTestSuiteActivity". Or do I need to use another one for this?
The Constructor looks like this:
Code: Select all
public EmailModule()
{
string result = TestReport.CurrentTestSuiteActivity.Status.ToString().ToUpper();
string reportName = TestReport.ReportEnvironment.ReportName.ToString();
int failedCount = TestReport.CurrentTestSuiteActivity.TotalFailedTestCaseCount;
int successCount = TestReport.CurrentTestSuiteActivity.TotalSuccessTestCaseCount;
string path = "<path_to_solution>\\bin\\Debug\\Reports";
this.From = "------- from ----";
this.To = "----- to -----";
this.Subject = String.Format("{0} <{1}>", result, reportName);
this.Body = String.Format("The test run finished with return <{0}>.{1}Failed test cases: {2}{1}Successful test cases: {3}{1}{1} Detailed reports can be found on vietest01.uc.local at \"{4}\" ", result, Environment.NewLine, failedCount, successCount, path);
this.Username = "";
this.Password = "";
this.ServerHostname = "----IP of exchange -----";
this.ServerPort = "25";
this.SendEmailOnFailure = true;
this.SendEmailOnSuccess = true;
this.SendPdfReportOnComplete = true;
}
best regards,
Dominik