How to get Screenshots for every step and not just failures

Ranorex Spy, Recorder, and Studio.
kshekharkumar
Posts: 24
Joined: Thu Feb 06, 2014 10:57 am

How to get Screenshots for every step and not just failures

Post by kshekharkumar » Thu Feb 06, 2014 11:06 am

Hi,

I wanted to know if Ranorex can provide screenshots for every step and not just failures.
If not then :
1. Can we expect it in future releases ?
2. How does screenshots for failures work? Does Ranorex take screenshots for every step but does not display until it has failed?

Currently I am using ver. 4.1.0.25227.

Thanks,
Shekhar

hnporter
Posts: 18
Joined: Thu Jan 16, 2014 3:34 pm

Re: How to get Screenshots for every step and not just failures

Post by hnporter » Thu Feb 06, 2014 8:33 pm

You can use Report.Screenshot to capture a screenshot at any point in your script.

kshekharkumar
Posts: 24
Joined: Thu Feb 06, 2014 10:57 am

Re: How to get Screenshots for every step and not just failures

Post by kshekharkumar » Fri Feb 07, 2014 11:09 am

Yes. That is what I am doing currently. But I was wondering if there was any one time configuration or something. Currently I need to make sure every module has Report.Screenshot.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to get Screenshots for every step and not just failures

Post by krstcs » Fri Feb 07, 2014 3:17 pm

Currently there is no way to do that.

The problem is that taking screen shots is resource intensive and uses a lot of disk space. It should not be done for every step unless there is a very good reason because it will fill up the disk, bog down the CPU, etc.

If you KNOW that you need to capture screen shots for certain steps, then you should be the one to put in the screen shots, which is how it is currently designed.

It is dangerous to have this be a test-wide toggle because it could easily eat up all resources on a system causing the tests to fail due to resource starvation.
Shortcuts usually aren't...

kshekharkumar
Posts: 24
Joined: Thu Feb 06, 2014 10:57 am

Re: How to get Screenshots for every step and not just failures

Post by kshekharkumar » Fri Feb 07, 2014 3:21 pm

Well that makes sense what you say.
Thanks for the reply. :)
Really appreciate!

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: How to get Screenshots for every step and not just failures

Post by mzperix » Thu Mar 27, 2014 9:18 am

Some side note on screenshots.

On making screenshots, you can give any reposiory element as a parameter. This way the report can contain only the proper element screenshot, not the whole program window.

User avatar
OverflowingStack
Posts: 8
Joined: Thu Mar 27, 2014 9:35 pm
Location: Clearwater, Florida
Contact:

Re: How to get Screenshots for every step and not just failures

Post by OverflowingStack » Mon Mar 31, 2014 8:22 pm

Just to expand on mzperix's advice,

Don't forget you may need to append a ".Self" on the repository item when using it as a parameter for Screenshot. The syntax should look like:
Report.Screenshot(repo.repoElement.Self);
Last edited by OverflowingStack on Tue Apr 01, 2014 1:12 pm, edited 1 time in total.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to get Screenshots for every step and not just failures

Post by krstcs » Mon Mar 31, 2014 9:27 pm

Just a note:

Adding ".Self" or ".SelfInfo" is only necessary for Repository ROOTED FOLDERS, not for regular items. Regular items should just be RepoItemName or RepoItemNameInfo.
Shortcuts usually aren't...

User avatar
OverflowingStack
Posts: 8
Joined: Thu Mar 27, 2014 9:35 pm
Location: Clearwater, Florida
Contact:

Re: How to get Screenshots for every step and not just failures

Post by OverflowingStack » Tue Apr 01, 2014 1:14 pm

Thank you for the distinction krstcs! I am still learning the ins and outs of Ranorex and really appreciate the wealth of knowledge and the friendly community here at the forums! :D