Page 1 of 1

Is there a 'best practice' on how to maintain screenshots?

Posted: Fri May 20, 2011 3:27 pm
by bkruse
Hi,

I've another question about "best practice" on image verification with coding.

Previously I've used the recorder to record the testcase and the verification steps. Also image verification.
I took the generated code and modified it to my needs. That resulted in parts like the below for a simple image verification step (some parts cut for clarity):

Code: Select all

	Validate.ContainsImage(repo....Cell0_row1Info, Cell0_row1_Screenshot1, Cell0_row1_Screenshot1_Options, Validate.DefaultMessage, false);
		}

	static CompressedImage Cell0_row1_Screenshot1 = new CompressedImage("iVBORw0KGgo...");

	static Imaging.FindOptions Cell0_row1_Screenshot1_Options = Imaging.FindOptions.Parse("1;None;0,0,0,0;True;10000000");
The question now:
If the image in the AUT changes, what is the best way to get this into the coded testcase?

Idea 1)
With Element Browser I can quickly create a screenshot of the element, store it as png and use Imaging.Load to create a Bitmap that can be used in compare/contains, etc.
But the issue here is that we have to create a whole structure to maintain and organize all screenshots.

Idea 2)
Another way is to use the existing repository (rxrep). They are already well structured and you can simply rightclick an item to capture a new screenshot. Great, everything seems to be there - but unfortunately I see no way access those images from coding. Do I miss something here?

Idea 3)
Use a temporary Recording1.rxrec to record an image validation step and let Ranorex generate the code.
Not that comfortable (and I have an issue with the capturing of table cells together with the GDI plugin, but that is my next task to seach the forum for, not to be discussed here).

Thanks for any input and hints.
regards, Björn

Re: Is there a 'best practice' on how to maintain screenshots?

Posted: Fri May 20, 2011 7:22 pm
by slavikf
bkruse wrote:Idea 2)
Another way is to use the existing repository (rxrep). They are already well structured and you can simply rightclick an item to capture a new screenshot. Great, everything seems to be there - but unfortunately I see no way access those images from coding. Do I miss something here?
You can access it from code. I do not remember how - let others answer...

However, i want to mention, that according to this post:
http://www.ranorex.com/forum/ranorex-cr ... shot#p7203
Ranorex is limited to certain number of screenshots, which it can store in Repositary. I reached that limit with about 50-60 screeshots in my project.

So, i store my screenshots in files and use Imaging.Load to retrieve them...

Re: Is there a 'best practice' on how to maintain screenshots?

Posted: Mon May 23, 2011 9:05 am
by bkruse
Thanks for the information and the link!
Definitely worth to consider for this decision.

But I'm still curious on how to access the Repository-stored screenshots from code. Didn't find any docu about this yet.

regards, Björn

Re: Is there a 'best practice' on how to maintain screenshots?

Posted: Tue May 24, 2011 9:38 am
by Support Team
Hi,

Sorry but at the moment it is not possible to access the screenshots inside a repository. In a future release of Ranorex we will provide the functionality. Currently you can only use the solution suggested by slavik.

Regards,
Peter
Ranorex Team

Re: Is there a 'best practice' on how to maintain screenshots?

Posted: Tue May 22, 2012 12:15 pm
by Hermch
Hi,

Sorry but at the moment it is not possible to access the screenshots inside a repository. In a future release of Ranorex we will provide the functionality. Currently you can only use the solution suggested by slavik.

Regards,
Peter
Ranorex Team
Are there any news on this topic? Is it now possible to access screenshots inside the repository.
If Yes, a code example would be great, if not, please tell me when this will be implemented?

Re: Is there a 'best practice' on how to maintain screenshots?

Posted: Wed May 23, 2012 10:05 am
by Support Team
Hi,

bascially this feature will be shipped with our next release Ranorex 3.3 which will be available very soon.
The image can be accessed using follwoing syntax:

Code: Select all

<RepoItemName>Info.Get<ScreenshotName>()
whereas <RepoItemName> is the name of the repository item, the screenshot is stored in and <ScreenshotName> is the name of the screenshot withn the repository item.

Regards,
Tobias
Ranorex Team

Re: Is there a 'best practice' on how to maintain screenshots?

Posted: Wed May 23, 2012 3:49 pm
by slavikf
Great news!
What about repository limits / capacity?
Will we be able to store hundreds big screenshots?

Re: Is there a 'best practice' on how to maintain screenshots?

Posted: Thu May 24, 2012 3:19 pm
by Support Team
Hi,
What about repository limits / capacity?
They will be much higher with 3.3 you will be able to save much more images than before.

Regards,
Markus
Ranorex Support Team