Wait Until 'Object' Exists Problem

Ask general questions here.
costamesakid
Posts: 94
Joined: Tue Jun 16, 2009 10:27 pm

Wait Until 'Object' Exists Problem

Post by costamesakid » Wed Mar 31, 2010 9:18 am

I have a script that launches an application as its 1st step. A splash screen is displayed until the application loads. The next step is User Code which which ensures a Windows Explorer dialog exists and then loads a map if it exists, and if it a map does not exists it 'clicks' cancel.

The problem is that splash screen takes anywhere from 8-20 seconds to load depending on the system and the User Code executes often executes before the application/map dialog is even displayed.

I tried this:

public static void MapDialogue()
{
Report.Info("Validating Exists on item 'FormOpen.ListItemPacificWorldMap'.");
while (repo.FormOpen.ButtonOpen1Info.Exists())
{
if (repo.FormOpen.ListItemMapInfo.Exists())
{
repo.FormOpen.ListItemMap.DoubleClick("center");
}
else
{
repo.FormOpen.ButtonCancel.Click("center");
}
}
}

I just dont want that code to execute until the splash screen closes and the dialog box 'exists'. and of course i have to avoid delays as I said the splash screen load is dependent upon the users system. Thanks!

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

Re: Wait Until 'Object' Exists Problem

Post by Ciege » Wed Mar 31, 2010 3:58 pm

Can Spy get the proper xPath of the splash screen? You can do a find on the splash screen as your first step then a wait until the splash screen is no longer visible.

Or you can get an xPath from an object in the AUT that does not appear until the splash screen is gone or maybe does not become enabled until the splash screen is gone. Then you can do a wait for that object to become visible or enabled.
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...

costamesakid
Posts: 94
Joined: Tue Jun 16, 2009 10:27 pm

Re: Wait Until 'Object' Exists Problem

Post by costamesakid » Tue Apr 06, 2010 10:53 pm

I ended up just doing a ValidateExists on the Form that loads after the splashscreen exits and set the timeout to that from object to 20s. As soon as the form loaded, Ranorex would validate it and then start executing my user code