Page 1 of 1

Form Comparison

Posted: Wed Apr 06, 2011 10:36 am
by atom
Hiya

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

Thanks

Re: Form Comparison

Posted: Wed Apr 06, 2011 1:53 pm
by Support Team
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

Re: Form Comparison

Posted: Wed Apr 06, 2011 1:58 pm
by atom
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

Re: Form Comparison

Posted: Wed Apr 06, 2011 2:33 pm
by Support Team
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

Re: Form Comparison

Posted: Wed Apr 06, 2011 4:46 pm
by atom
Hiya

I think i'll use element.equals

Thanks