Wait for a specific window to appear

Class library usage, coding and language questions.
chris31
Posts: 1
Joined: Tue Dec 03, 2013 8:16 am

Wait for a specific window to appear

Post by chris31 » Tue Dec 03, 2013 8:25 am

Hi

I've just started with Ranorex and already have a small question. In my test the time between screens switching in my application is really machine / test setup dependent.
How can i wait for a specific window to appear ( with a timeout of course ) before running the rest of my test ?

TIA

Christophe.

Swisside
Posts: 92
Joined: Thu Oct 10, 2013 9:40 am

Re: Wait for a specific window to appear

Post by Swisside » Tue Dec 03, 2013 11:02 am

Hello

You can add a new usercode action and write those lines :

public void waitForWindow()
			
		{
			//Wait until the windows is enabled
			while(!repo.MyWindow.Self.Enabled){
			
				//do nothing
			}
			//When the windows is enabled continue the test
			
			Report.Info("Continue Test");
			
		}

Regards
A simple thank you always does wonders !

bru
Posts: 18
Joined: Thu Oct 31, 2013 10:22 am
Location: Linz / Austria

Re: Wait for a specific window to appear

Post by bru » Tue Dec 03, 2013 1:04 pm

Another solution for this could be to increase the "Search Timeout" of the Repository Item your test script will have to wait for.

Right-click the repository item, select "Properties" in the context menu and set the property "Search Timeout".