Page 1 of 1

How to add listener on the element's property change event

Posted: Mon Apr 08, 2013 12:53 pm
by Oksana
Hi!

Are there a possibility to add listener on the event of changing some element's property, such as: visible, text?

I've seen in user guide "Handling unexpected Dialogs" (http://www.ranorex.com/support/user-gui ... mples.html), but it is not exactly what I need.

The matter states in following:
There is a text element.
TextValue for it is changing from time to time.
I need to perform some actions when the TextValue is changed.

Is it possible to do such thing in Ranorex?

Type of AUT is flash.

Thanks,
Oksana.

Re: How to add listener on the element's property change event

Posted: Tue Apr 09, 2013 5:04 pm
by Ciege
Do you need this check to occur dynamically (while other tests are running) or not?

If you need it while other tests are running you will need to create a second helper thread to check the state of the element you want... Otherwise, if you just need to wait for this state in the same main thread, you can easily use a loop to check the state of the element you want to check until it meets your criteria.

Re: How to add listener on the element's property change event

Posted: Wed Apr 10, 2013 6:52 am
by Oksana
Thanks!

Actually, I will use two approaches: 1)with another helper thread and 2)checking for the criteria in the same (main) thread, - in differenct cases.

I just wanted to know maybe this functionality was already implemented in Ranorex classes (something similar to Watch method from PopupWatcher class), but as far as I understood, I need to create such method by myself.

Re: How to add listener on the element's property change event

Posted: Thu Apr 11, 2013 1:55 pm
by Support Team
Hi,

There is no such method which will automatically inform you about a change in one of your elements, but as Ciege mentioned this can be easily done with a helper thread or with the use of the PopupWatcher which is more or less also "just" a thread which performs specific actions.

Regards,
Markus