Can we subscribe to events fired by application under test?

Ask general questions here.
jack_r_daniels
Posts: 17
Joined: Fri Feb 12, 2010 5:33 pm

Can we subscribe to events fired by application under test?

Post by jack_r_daniels » Tue Feb 16, 2010 8:30 pm

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.

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

Re: Can we subscribe to events fired by application under test?

Post by Ciege » Tue Feb 16, 2010 8:34 pm

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.
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...

jack_r_daniels
Posts: 17
Joined: Fri Feb 12, 2010 5:33 pm

Re: Can we subscribe to events fired by application under test?

Post by jack_r_daniels » Tue Feb 16, 2010 9:35 pm

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

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

Re: Can we subscribe to events fired by application under test?

Post by Ciege » Tue Feb 16, 2010 9:44 pm

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
}
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...