## Test reports through email

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

### Re: Test reports through email

Hi,
Execution and emailing works fine now when Tests are executed manually. While running the same test from Windows task scheduler, email without attachment (log file) is being sent out. Please assist.

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

### Re: Test reports through email

Hi. It perfectly works with email attachments when executed manually. But when executing through windows job scheduler, it only sends a mail after test execution. Attachments are missing.

odklizec
Ranorex Guru
Posts: 6016
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

### Re: Test reports through email

Hi,

It's hard to say without seeing the project, but I would guess there is wrong path somewhere. Are you sure the report file is at the defined path (defined in project settings)? Could you please post the project or at least a screenshot of project settings?

By running the test manually you mean double clicking the exe file or starting the test via studio?

How exactly do you start the test via scheduler? By calling the exe or via batch file?

Maybe it's required to set correct working directory before running exe?
I would suggest to create a cmd file, in which you first set the working directory and only then start the test. Something like this:

Code: Select all

cd %~dp0
c:\path\to\test.exe
Pavel Kudrys
Ranorex explorer at Descartes Systems

• Ranorex Snapshot. Learn how to create one >here<
• Ranorex xPath of problematic element(s)
• Ranorex version
• OS version
• HW configuration

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

### Re: Test reports through email

Hi,
I have not defined the report path in Proj settings. Plz suggest how we do it. When i execute it through cmd.... .exe I dont get any mail. But when executed via studio or double click on exe I get the mail with attachment. PFA Project file. Through windows Task scheduler i have given the .exe path (Debug\...exe)
Attachments
Waldemar_1.zip

odklizec
Ranorex Guru
Posts: 6016
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

### Re: Test reports through email

Hi,

As I've expected, when the exe is started via task scheduler, the report is not created in the test directory but in C:\Windows\System32 And this could be a reason why the report files are not created there (if the exe is started with non-admin privileges). I don't have a clue why this happens. However, you should be able to use the workaround I described yesterday.

Just create start.cmd file (in the same folder as Waldemar_1.exe) and fill it with these two lines:
cd %~dp0
Waldemar_1.exe
Then use this start.cmd in your scheduled job. First line sets correct working directory and so the report should be correctly created in the same folder as exe started from next line. Hope this helps?
Pavel Kudrys
Ranorex explorer at Descartes Systems

• Ranorex Snapshot. Learn how to create one >here<
• Ranorex xPath of problematic element(s)
• Ranorex version
• OS version
• HW configuration

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

### Re: Test reports through email

Hi. Did the way suggested. The Task scheduler comes (blinks) for a very short moment and fades away. I see from the Task scheduler that it has started, but the Test case is never brought up or executed. Please find attached the corresponding snap shots.

odklizec
Ranorex Guru
Posts: 6016
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

### Re: Test reports through email

Have you tried to run the cmd file manually?

It sounds like the exe is not started from the batch file? Are you sure the exe has correct name in cmd file and that the exe is in the same directory as cmd file? Could you please share the cmd file and path where you have stored exe and cmd?
Pavel Kudrys
Ranorex explorer at Descartes Systems

• Ranorex Snapshot. Learn how to create one >here<
• Ranorex xPath of problematic element(s)
• Ranorex version
• OS version
• HW configuration

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

### Re: Test reports through email

Hi. i was about to provide the information. But attempted a different approach before. IT WORKS....
The file path of cmd and exe were always same. The path in the Task scheduler also was same. But the path contained spaces in it. Attempted without a space and it works. Now the task executes via task scheduler and also generates the reports. Thats the end of my requirement. Thank you for your suggestions. . I am about to post one more clarification (Recursive entry in a search box), please see if you can respond to it.

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

### Re: Test reports through email

Hi. I am unable to send mail on the report. Have definitely enabled the zip option for report generation. Please assist. Also attached the project files for ref.
Attachments
GEA_Regression.zip

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

### Re: Test reports through email

Hi. could someone respond to this query please.

Support Team
Posts: 12085
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

### Re: Test reports through email

Hi satishmohan,

May I ask to explain the issue in more detail?
Did you make any modifications to your code recently?

Additionally, it would be great if you could upload the complete Ranorex Solution.

Kind regards,
Johannes
.

Certified Professional
Posts: 74
Joined: Mon Aug 14, 2006 7:17 pm
Location: CH

### Re: Test reports through email

Hi,

May you should call the SendMail usercode module. In your test suite you are not calling the SendMail or even not in the recording.

Cheers
Dan

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

### Re: Test reports through email

Hi. Sorry for the delay. It worked without a change

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

### Re: Test reports through email

Hi. The latest email for new project is not working. Attempted to implement as suggested in this thread. Please find attached the project folder.

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

### BLOCKER : Test reports through email

Hi Team. Could someone look into this asap. Stuck on this for more than a day