Ranorex crashed after recording of image validation

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

Ranorex crashed after recording of image validation

Post by slavikf » Sat Jan 15, 2011 1:43 am

Ranorex crashed after recording of image validation
Steps to reproduce:
- Run our application (MFC, C++, win32, MDI)
- In Ranorex click Record
- Click Validate
- Select Image -> Compare (or contain)
- Click Stop
At this moment Ranorex crash.
System:
- Ranorex version 2.3.7
- Win7 32 bits, Nvidia Quadro NVS285
- Tried resolutions: 1600x1200 and 1280x960
- I tried to restart system few times
Notes:
- Attaching screenshot of crash and Snapshot of AUT at that moment
- I can't send you our application - it will not work, because it uses hardware copy-protection. But if you want to reproduce it on my machine - i can give you LogMeIn access. Please contact me SlavikCA at gMail.com
You do not have the required permissions to view the files attached to this post.

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

Re: Ranorex crashed after recording of image validation

Post by slavikf » Sat Jan 15, 2011 1:46 am

Attaching SnapShot
You do not have the required permissions to view the files attached to this post.

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

Re: Ranorex crashed after recording of image validation

Post by slavikf » Sat Jan 15, 2011 2:17 am

Few more findings:
- I can't record image validations, which i was successfully recording with Ranorex 2.3.5
- I find one program, where you can reproduce issue:
Download free version here:
http://www.tiffviewer.com/download.htm

Open image file:
http://slavikf.com/files/Ph7.1

And try to validate image element in Ranorex, using same steps, as above...

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

Re: Ranorex crashed after recording of image validation

Post by slavikf » Mon Jan 17, 2011 8:04 pm

Issue reproduced in Ranorex 2.3.8.
Please, update, with status. This is critical failure for us.

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

Re: Ranorex crashed after recording of image validation

Post by slavikf » Mon Jan 17, 2011 10:11 pm

Downgraded to Ranorex 2.3.5.
Issue still reproduced on same computer.

Tried to install Ranorex 2.3.8 on another computer i have (Win XP) - issue is not reproduced.
So, issue is system-dependent.

Tried get older nVidia video drivers. Issue is still reproduced on same Win7 computer...

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

Re: Ranorex crashed after recording of image validation

Post by Support Team » Tue Jan 18, 2011 9:11 am

Hi,

I'm sorry about the delay, it just takes some time to reproduce issues like that and return some useful information. We're trying to reproduce your issue and will give you support as soon as possible.

Just remember that this is a forum. That means we will try to answer every (unanswered) question, but we will not ping-back on every new forum post immediately. Instead we will post an answer as soon as we have information that is useful to the public. This also gives other users time to jump in and post answers.

Kind regards,
Tobias
Support Team

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

Re: Ranorex crashed after recording of image validation

Post by Support Team » Tue Jan 18, 2011 9:07 pm

We could reproduce the problem with that image and it is not specific to the image viewer. The problem is that this image is quite large and very information dense. As Ranorex internally stores images in the PNG format, the code generated for that image is rather large: a 3 MB C# file with 35000+ lines.

The funny thing is that everything Ranorex specific works fine even with such a large code file, however, the code parser integrated in Ranorex Studio (that is actually inherited from Sharp Develop that Ranorex Studio is based on) throws a StackOverflowException when parsing the recording code file. The same obviously happens when you open the file in Visual Studio (2008 or 2010), it crashes as well.

Until we find a solution to that problem, a workaround is to manually store the screenshot and add a user code item that performs the validation. You can use Ranorex Spy to store the screenshot to a file (see this section in the Ranorex User Guide) and then load that file in user code and perform the validation as follows:
Bitmap image = Imaging.Load("screenshot.png");
Validate.ContainsImage(repo.MyImageInfo, image, Imaging.FindOptions.Default);
Regards,
Alex
Ranorex Team

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

Re: Ranorex crashed after recording of image validation

Post by slavikf » Tue Jan 18, 2011 10:20 pm

Interesting...

I reinstalled Windows and Ranorex and it started to work for me on Sample application (Brava Reader).

However after i opened my AUT with a lot screenhots taken already - problem started to reproduce again. Even on sample application.

So, what's your plans for that issue, other then work-around with Ranorex Spy? Or it is impossible to fix?

Do you plan to upgrade IDE to SharpDevelop 4.0?

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

Re: Ranorex crashed after recording of image validation

Post by slavikf » Wed Jan 19, 2011 1:41 am

As i looking at Validation methods, i see there are two kinds:
public static void ContainsImage(
	Element element,
	Bitmap image,
	Imaging..FindOptions findOptions
)

public static void ContainsImage(
	RepoItemInfo itemInfo,
	Bitmap image,
	Imaging..FindOptions findOptions
)
One use Element and other use iteminfo of that element.
What would be advantages of each method and why we have two?

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

Re: Ranorex crashed after recording of image validation

Post by Support Team » Wed Jan 19, 2011 9:58 pm

slavikf wrote:So, what's your plans for that issue, other then work-around with Ranorex Spy? Or it is impossible to fix?
It looks like we found a way to generate the code for the screenshots a little different that does not cause a stack overflow of the parsing engine. If this fix passes the testing phase, we will include it in the next service release.
However, if you add many screenshots, which are similar in size and information density, to the repository, you might run into a memory problem, because every image uses a few dozens of MBs of memory. The "workaround" to store all images in separate files may be the safer approach.
slavikf wrote:Do you plan to upgrade IDE to SharpDevelop 4.0?
This is in the queue for one of the next minor versions after Ranorex 3.0.
slavikf wrote:One use Element and other use iteminfo of that element.
What would be advantages of each method and why we have two?
If you use the RepoItemInfo, then you get a ValidationException even if the element cannot be found. If you use an element, you have to find the element first and might get an ElementNotFoundException. Additionally, the message in the report will be more useful if you pass the RepoItemInfo, since it will then contain the name of the repository item.
So passing a RepoItemInfo is the preferred option.

Regards,
Alex
Ranorex Team

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

Re: Ranorex crashed after recording of image validation

Post by slavikf » Fri May 27, 2011 5:21 pm

Support Team wrote:It looks like we found a way to generate the code for the screenshots a little different that does not cause a stack overflow of the parsing engine. If this fix passes the testing phase, we will include it in the next service release.
Can you tell if that issue fixed in 3.0.2?:
Ranorex 3.0.2 Release (May 19, 2011)
General changes/Features
Improved performance when working with large projects (with many recordings/repositories) in Ranorex Studio

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

Re: Ranorex crashed after recording of image validation

Post by Support Team » Mon May 30, 2011 10:27 am

Hi slavik,

I've looked to our bug tracking system and this should be fixed with Ranorex 3.0.2. The corresponding bug is verified and fixed.

Regards,
Peter
Ranorex Team