Form Comparison

Class library usage, coding and language questions.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Form Comparison

Post by atom » Wed Apr 06, 2011 10:36 am

Hiya

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

Thanks

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

Re: Form Comparison

Post by Support Team » Wed Apr 06, 2011 1: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
.
Image

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Form Comparison

Post by atom » Wed Apr 06, 2011 1: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

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

Re: Form Comparison

Post by Support Team » Wed Apr 06, 2011 2: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
.
Image

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Form Comparison

Post by atom » Wed Apr 06, 2011 4:46 pm

Hiya

I think i'll use element.equals

Thanks