Hi,
I am using EmaiModule in [TEARDOWN]
How should I call it to add data after testrun?
I would like to add testrun date to subject and some details about failed cases to body.
Could someone please give some example code how to do it.
EmailModule & body text
Re: EmailModule & body text
Should I add the code here:
Code: Select all
private void OnTestSuiteCompletedSendResult(object sender, EventArgs e)
{
var currentTestSuiteStatus = TestReport.CurrentTestSuiteActivity;
var reportFile = CreateReports();
this.Subject = "Something here?";
if (this.SendEmailOnFailure && currentTestSuiteStatus.Status == ActivityStatus.Failed
|| this.SendEmailOnSuccess && currentTestSuiteStatus.Status == ActivityStatus.Success
|| this.SendZippedReportOnComplete && !this.SendEmailOnFailure && !this.SendEmailOnSuccess
|| this.SendPdfReportOnComplete && !this.SendEmailOnFailure && !this.SendEmailOnSuccess)
{
EmailLibrary.SendEmail(
this.Subject,
this.To,
this.From,
this.Body,
reportFile,
this.ServerHostname,
int.Parse(this.ServerPort),
this.UseSSL,
this.Username,
this.Password);
}
}
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: EmailModule & body text
Hi SanMan,
You can add custom body text here - just ensure it remains a string. Note, += will append to the end of the body, while = will replace the body text.
I hope this helps!
Cheers,
Ned
You can add custom body text here - just ensure it remains a string. Note, += will append to the end of the body, while = will replace the body text.
I hope this helps!
Cheers,
Ned
You do not have the required permissions to view the files attached to this post.
Re: EmailModule & body text
Hi Ned,
thank you for your help. Just what I wanted to know.
One more question about EmailModule:
- Can I attach report as *.html so it can be opened without Ranorex Report Viewer?
thank you for your help. Just what I wanted to know.
One more question about EmailModule:
- Can I attach report as *.html so it can be opened without Ranorex Report Viewer?
Re: EmailModule & body text
Only if you attach it zipped along with *.rxlog.data. *.xsl, *.css, *.png and report image folder. Report file is not just HTML that must be included. Additionally, you must rename *.rxlog.data to *.html.data.SanMan wrote:- Can I attach report as *.html so it can be opened without Ranorex Report Viewer?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: EmailModule & body text
Thank you!
I also found, that when I add text to body, Environment.newline does not work (work, but email is send as *.html) and outlook does not show the line break.
I tried to use "</br>" instead but it did not help.
Am I able to set somewhere that email is sent as text?
I also found, that when I add text to body, Environment.newline does not work (work, but email is send as *.html) and outlook does not show the line break.
I tried to use "</br>" instead but it did not help.
Am I able to set somewhere that email is sent as text?