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

Ask general questions here.
Oksana
Posts: 64
Joined: Tue Jan 15, 2013 10:20 am

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

Post by Oksana » Mon Apr 08, 2013 12:53 pm

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.

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

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

Post by Ciege » Tue Apr 09, 2013 5:04 pm

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.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

Oksana
Posts: 64
Joined: Tue Jan 15, 2013 10:20 am

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

Post by Oksana » Wed Apr 10, 2013 6:52 am

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Thu Apr 11, 2013 1:55 pm

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