Page 1 of 1
Can we subscribe to events fired by application under test?
Posted: Tue Feb 16, 2010 8:30 pm
by jack_r_daniels
I'm wondering if there is a way for Ranorex to subscribe and react to events being fired by the application under test (without interfering with the normal functions of the app). For example, let's say I want to click on a button that will refresh a grid/table, or I want to open a form. I don't want to hard code a Delay because the amount of time to wait will vary depending on the amount of data. Is there a way for Ranorex to know that it should wait until the operation has completed? Or for Ranorex to listen in to events being fired by the app and then react to the event fired? Thanks in adavnce...
Jack.
Re: Can we subscribe to events fired by application under test?
Posted: Tue Feb 16, 2010 8:34 pm
by Ciege
How does the user know when the AUT is ready after an event?
Have Ranorex do the same thing. If there is a "working" text somewhere in the AUT have Ranorex wait until that text is gone. Or have Ranorex wait until the mouse cursor is no longer an hour glass... Etc...
Easiest is to mimic what a user needs to see to know that an operation has completed.
Re: Can we subscribe to events fired by application under test?
Posted: Tue Feb 16, 2010 9:35 pm
by jack_r_daniels
Hi Ciege
Let's say that I take your suggested approach of waiting for some text somewhere to change...
Ciege wrote:If there is a "working" text somewhere in the AUT have Ranorex wait until that text is gone.
How do i got about doing that? Do I check the status in a loop with a small delay period? Or, is there some built in mechanism that ranorex has that allows it to monitor a status bar for some string to appear? Thanks for your response,
Jack
Re: Can we subscribe to events fired by application under test?
Posted: Tue Feb 16, 2010 9:44 pm
by Ciege
You can write a small loop to do it.
For Example:
First, get the object that contains the "working" text.
Next, while the text = "Working" delay for 0500.
Check again.
Pseudo code:
Code: Select all
RanorexObject = Working_Object;
While (Working_Object.text = "Working")
{
delay 0500
}