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

Class library usage, coding and language questions.
bkruse
Posts: 39
Joined: Tue Jul 20, 2010 12:19 pm

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

Post by bkruse » Fri May 20, 2011 3:27 pm

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

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

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

Post by slavikf » Fri May 20, 2011 7:22 pm

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

bkruse
Posts: 39
Joined: Tue Jul 20, 2010 12:19 pm

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

Post by bkruse » Mon May 23, 2011 9:05 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Tue May 24, 2011 9:38 am

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

Hermch
Posts: 40
Joined: Thu May 26, 2011 7:17 am
Location: Germany

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

Post by Hermch » Tue May 22, 2012 12:15 pm

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Wed May 23, 2012 10:05 am

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

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

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

Post by slavikf » Wed May 23, 2012 3:49 pm

Great news!
What about repository limits / capacity?
Will we be able to store hundreds big screenshots?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Thu May 24, 2012 3:19 pm

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