Wait Until 'Object' Exists Problem
Posted: 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!
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!