Form Comparison : Automation API

Form Comparison

Class library usage, coding and language questions.

Form Comparison

Postby atom » Wed Apr 06, 2011 11:36 am

Hiya

I have two ranorex.form objects
How can i test that they are representing the same windows?

Thanks
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: Form Comparison

Postby Support Team » Wed Apr 06, 2011 2:53 pm

Hi,

what exactly do you want to automate.
Please explain your steps of automation a little more specific.
Do you have to windows opened holding the same content, or what is the us of this validation?

So please explain more precisely what you want to do.

Regards,
Tobias
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Form Comparison

Postby atom » Wed Apr 06, 2011 2:58 pm

Hiya

I have a Form object that represents the window i want to test
This window is a modal dialog window
However I want to also check for error dialogs when i do operations in this window
So i have a function that gets all top Form objects with same process id
Now i want to eliminate from this list the form object for the window under test
So i was thinking does the .Equals method work for Form objects
And it does, does it use all object properties to determine equality

Thanks
Clayton
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: Form Comparison

Postby Support Team » Wed Apr 06, 2011 3:33 pm

Hi,

the method Form.Equals won't fit your issues.
You have to use the internal method Element.Equals, which compares if two objects represent the same UI element.

Another way is to use a unique attribute of the form to eliminate. So you can use following path to get all the forms except the one you want to eliminate:
Code: Select all
/form[@<the_attribute_with_the_unique_value>!='<the_unique_value>']


Regards,
Tobias
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Form Comparison

Postby atom » Wed Apr 06, 2011 5:46 pm

Hiya

I think i'll use element.equals

Thanks
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests