Page 1 of 1

Question about Send email module - body with report summary possible?

Posted: Wed Sep 02, 2020 7:31 am
by BlindJones
Hello everyone!

We are using the send email module in our solutions and my boss asked me, whether it is possible to create a notification email without an attached pdf or zipped report. He only wants to see the summary of the test suite in the email body to see at the first glance, how many test cases failed in that suite. As in this screenshot (of a beginning of a report) attached to this post.

Is there any way to realize that?

Thanks a lot!

BlindJones

Re: Question about Send email module - body with report summary possible?

Posted: Thu Sep 10, 2020 8:59 am
by BlindJones
So, since nobody knows an answer, would it be possible to generate a pdf file with only the summary on top?
I know I can set the details to "none", but the performed recordings are still displayed in the pdf...

Can I change some code in "ReportToPDFModule" to create a PDF with only the summary?

Thank you everyone. :)

Kind regards
BlindJones

Re: Question about Send email module - body with report summary possible?

Posted: Mon Sep 14, 2020 9:28 am
by BlindJones
Good morning,

I managed now to get rid of some unwanted information in the pdf (sent by mail) by configuring the custom-style.xml (see attachment PDF_first_page).

Sadly, there are still more pages created with informations regarding the testsuites and the recordings (see attachment PDF_second_page)...

Is it possible to get rid of that informations? So only the first page of the PDF is created? Can I configure the XML - file accordingly?
Or maybe make some changes to the Emailmodule.cs in Ranorex?

Thank you for the help.

Best regards
BlindJones

Re: Question about Send email module - body with report summary possible?

Posted: Mon Sep 14, 2020 9:47 am
by odklizec
Hi,

I'm afraid, I'm not using PDF at all, so I can't help you with this. But you should be able to extract test suite status via API.

Code: Select all

var tcStatus = Ranorex.Core.Reporting.ActivityStack.Current.Status; // returns test suite status
Eventually, you can use this for particular test case(s):

Code: Select all

var tcStatus = TestSuite.Current.GetTestContainer("tcName").Status; // get status of specified TC

Of course, it should be possible to get also other test case/suite details via API.

Re: Question about Send email module - body with report summary possible?

Posted: Mon Sep 14, 2020 10:12 am
by BlindJones
odklizec wrote:
Mon Sep 14, 2020 9:47 am

Code: Select all

var tcStatus = Ranorex.Core.Reporting.ActivityStack.Current.Status; // returns test suite status
Hi Pavel,

that sounds really great. Do you know how to bring this information into the email body? To report there the content of a variable? Then maybe we don´t need to send a whole PDF by mail...

Thank you very much! :)

Best regards
Sebastian

Re: Question about Send email module - body with report summary possible?

Posted: Mon Sep 14, 2020 10:23 am
by odklizec
Hi,

Well, I'm not using integrated emailing as well :D So I can only guess that there must be a way to fill certain aspects of email via variables? So you must first get the informations you want, store them in variables (SmartFoer/TestCase/Suite parameters) and use them in email method?
How exactly do you implement emailing in your project?

BTW, the status method I posted must be called in program.cs. It will not return test suite status if used anywhere in the test suite (e.g. Test Suite TearDown section).

Re: Question about Send email module - body with report summary possible?

Posted: Mon Sep 14, 2020 10:59 am
by BlindJones
Hi,

since I am not so deep into C#, I use the predefined "sendemailmodule" provided by Ranorex.
And just fill up the predefined variables with my content (as shown in the screenshot).

I tried to copy your code into the "program.cs", but the solution will not work any longer then. And I really don´t know how to use that variable then to generate a email body with the status.

It´s very complicated when you are not able to code... :cry:

Best regards
Sebastian

Re: Question about Send email module - body with report summary possible?

Posted: Mon Sep 14, 2020 11:52 am
by odklizec
Hi,

You need to place the code in program.cs, as shown here:
testsuite-fails-but-activitystack-statu ... tml#p55894

I'm afraid, successful TA without, at very least, basic knowledge of coding is just a myth. But guess what? I'm not programmer at all and all I know about C# is from using Ranorex :D So don't worry and keep automating!

Re: Question about Send email module - body with report summary possible?

Posted: Mon Sep 14, 2020 12:22 pm
by BlindJones
Hi,

thank you, I added the line of code successfully in the program.cs :)

But now I wonder how to use the variable "tcStatus" in the "emaimodule.cs".

With "Report.tcStatus"? :?:

Best regards
Sebastian

Re: Question about Send email module - body with report summary possible?

Posted: Mon Sep 14, 2020 12:30 pm
by odklizec
Hi,

I'm not quite sure if Ranorex helpers implementation of sending emails is usable in this scenario, because the code I suggested is actually called after the email is sent. I think you will have to implement email sending via SendMail.cs module, as discussed here:
send-mail-module-t2356.html
I believe that email sending via Ranorex helpers uses part of SendMail module? You will just have to implement sending emails via program.cs. But as I mentioned, I'm not sending emails via Ranorex tests, so I can be completely wrong ;)

Re: Question about Send email module - body with report summary possible?

Posted: Wed Oct 07, 2020 1:14 pm
by BlindJones
Hi Pavel,

I found an old thread here in the forum and in the post from "Support Team » Fri Sep 28, 2012 1:47 pm" Markus described exactly what I am trying to achieve, even a summary in the email body. Even a zip-archive was posted (and is still downloadable), but sadly the solution will not work with Ranorex 9.3 anymore (the rxtst. file can not be opened).

Here is the link: sending-an-email-of-test-results-t1720.html

Can you please have a look and tell me whether I can use this to implement it into my solution?
Must the code be adapted to Ranorex 9.3?

Thank you very much in advance!

Kind regards
Sebastian