Need suggestion on sending report via email

Best practices, code snippets for common functionality, examples, and guidelines.
Posts: 52
Joined: Wed Dec 16, 2015 4:03 pm

Need suggestion on sending report via email

Post by ziasim » Thu Oct 04, 2018 12:31 pm


We are in a process to integrate Ranorex with Jenkins to run tests more often using CI jobs. Our setup is like

1 - Jenkins master machine A
>>>Used to start CI job

2- Jenkins slave machine B
>>>Used to build and copy AUT & RTS to some remote VM, scripts will be started on remote VM using PSEXEC

3- Remote virtual machine C
>>>Used for actual script execution to test AUT

As you can understand, scripts will be executed on machine C so reports will also be generated on this machine. Now to send these reports to intended recipients, I can think off two approaches

- Use Ranorex Automation Helper's email module - Currently I am testing with this module and it is working OK to send reports to multiple recipients .

- Use Jenkins Email plugin to send email with attached reports - ATM I am not sure how to do this because the test report is on machine C and I don't know a way to copy this report back to Jenkins slave so that i can send this report via email.

I am more inclined to use Jenkins email plugin to send reports via email due to the fact that more options(customization) are available in this plugin as compared to email module of Ranorex.

Is there a good way to fetch report from machine C(scripts execution machine) to machine B (Jenkins slave) so I can email to respective people using email plugin??

User avatar
Ranorex Guru
Ranorex Guru
Posts: 7464
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Need suggestion on sending report via email

Post by odklizec » Thu Oct 04, 2018 12:41 pm


As mentioned in another post, is there a reason why you can't make the machine "C" an actual Jenkins slave, which would be a part of regular Jenkins build&test job? I mean, this would solve most of your problems ;) Eventually, run the test directly on machine B.
Pavel Kudrys
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

Posts: 52
Joined: Wed Dec 16, 2015 4:03 pm

Re: Need suggestion on sending report via email

Post by ziasim » Thu Oct 04, 2018 2:08 pm

Hi Pavel,

Let me try to explain why we can't use agents/slaves for script execution.

We have multiple teams with their own product portfolios, some have one product, some have two or more products. All these teams are using same Hyper-V infrastructure based on the assigned pool of resources. Whenever a team require new VM, they will create it from their own pool. Now

Team A have four products to test using automated scripts

Team B have one product to test using automated scripts

Team C have two product to test using automated scripts

We have one automation team which is responsible for all products scripts creation/management. From management perspective they want

- Each team should use its own allotted resources to create new test VM.
- Anyone should able to run automated scripts like developer, tester, CS etc.

To achieve this, we are building framework within Jenkins like

- Create new test VM using CI job (machine will be created from within teams assigned resource quota)
- Build, Copy and start execution on new VM
- Once testing done, delete new created VM to spare resources for others to use

Most of our AUT's have server/client applications and to test properly we need two separate machines, one for server and other for client application. So to test 3 different products, we need 6 machines for one team. We already have 4 agents configured with our Jenkins master.

We think that adding 6 more machines as an agent with same server having 4 agents already (to build AUT) for team A is not good option. And then we have team B and team C. Management is not willing to add another Jenkins master so its out of question.

By doing the way we are trying to do is

- We will add one more agent with Jenkins master.
- Any team want to test some scripts will create its test machines from allocated resources using configured CI job. Other teams resources will not be utilized.
- On new created machine they will do their testing
- Once this machine is no more required they will remove them to free some resources for other team members using CI job.

In summary, we want each team use its own machines for script execution and we can't add 10~12 machines as an agent with existing Jenkins master. So the solution for us is to run scripts on remote machines not on agents/slave machines.

I hope I clarified some bits at least but now I need solution for my original problem :D

User avatar
Posts: 284
Joined: Wed Jan 25, 2017 11:08 am

Re: Need suggestion on sending report via email

Post by qwertzu » Fri Oct 05, 2018 8:47 am

reports will always be created on the machine on which you run your test.
The only thing you could try is to set the report directory to a network drive to which both of your machines have access.
However, still I would suggest using Ranorex Automation Helpers email module which works perfectly fine and can send the exact ranorex report and a pdf report via email.

regards, qwertzu