Test reports through email

Ask general questions here.
satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

Re: Test reports through email

Post by satishmohan » Tue Jun 23, 2015 12:59 pm

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

Post by satishmohan » Tue Jun 23, 2015 1:25 pm

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.

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

Re: Test reports through email

Post by odklizec » Tue Jun 23, 2015 2:12 pm

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

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

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

Re: Test reports through email

Post by satishmohan » Tue Jun 23, 2015 4:40 pm

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
(216.73 KiB) Downloaded 69 times

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

Re: Test reports through email

Post by odklizec » Wed Jun 24, 2015 8:09 am

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

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

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

Re: Test reports through email

Post by satishmohan » Wed Jun 24, 2015 10:25 am

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.

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

Re: Test reports through email

Post by odklizec » Wed Jun 24, 2015 10:56 am

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

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

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

Re: Test reports through email

Post by satishmohan » Wed Jun 24, 2015 11:17 am

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. :P . 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

Post by satishmohan » Thu Oct 22, 2015 4:06 pm

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
(475.16 KiB) Downloaded 49 times

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

Re: Test reports through email

Post by satishmohan » Fri Oct 23, 2015 9:58 am

Hi. could someone respond to this query please.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Test reports through email

Post by Support Team » Fri Oct 23, 2015 1:00 pm

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.

Thank you in advance.

Kind regards,
Johannes
.
Image

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

Re: Test reports through email

Post by CookieMonster » Fri Oct 23, 2015 1:01 pm

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.
May this is your problem.

Cheers
Dan

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

Re: Test reports through email

Post by satishmohan » Fri Nov 06, 2015 3:22 pm

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

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

Re: Test reports through email

Post by satishmohan » Wed May 11, 2016 8:55 am

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

Post by satishmohan » Thu May 12, 2016 8:49 am

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