Image validation fails after being converted to user code

Ranorex Spy, Recorder, and Studio.
Luis Leon
Posts: 10
Joined: Tue Aug 10, 2010 12:18 am

Image validation fails after being converted to user code

Post by Luis Leon » Thu Aug 26, 2010 6:38 pm

Hi,

I used the Image validation item on the action recorder in order to check for a given icon, this action has to be executed in a given situation so I decided to convert it to user code in order to add the required logic.

However, the user code generated does not run since the taken screenshot of the control is not accesible from this context. this is the generated code:

public static void Validate_TextWarning_ico1()
{
//Your code here. Code inside this method will not be changed by the code generator.
Report.Info("Validating ContainsImage (Screenshot: 'Screenshot1' with region {X=0,Y=0,Width=64,Height=64}) on item 'FormWarning_for_recommended_.TextWarning_ico'.");
Validate.ContainsImage(repo.FormWarning_for_recommended_.TextWarning_icoInfo, TextWarning_ico_Screenshot1, TextWarning_ico_Screenshot1_Options, Validate.DefaultMessage, false);

}

The parametes in bold are not found in the user code file context and I can't find them anywhere.

Is there a workaround for this situation?

Regards,

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

Re: Image validation fails after being converted to user code

Post by Support Team » Fri Aug 27, 2010 9:56 am

This sounds like a bug that has already been fixed with Ranorex release 2.2.2. See its release notes:
http://www.ranorex.com/download/release ... html#c2721

What version of Ranorex do you use? Please update to the latest Ranorex version:
http://www.ranorex.com/download.html

After you update to version 2.2.2 or newer, you might need to re-create the original record item and then convert it to user code again.

Regards,
Alex
Ranorex Team
.
Image