Ignoring splash screens

Apr 28, 2009 at 3:57 PM
I'm testing an app that has a splash screen - this splash screen runs on a different thread, pops up for 10 seconds while the app loads and then vanishes, leaving the "real" window behind.

If I say:
window.Get(SearchCriteria.ByAutomationId("My Actual Window"))

while the splash screen is up then it returns null rather than waiting for the real window to appear.

I have the BusyTimeout set to 60000 - is there a different setting I can try to make it wait up to 60 seconds for the right window to appear, ignoring any other windows?

Apr 28, 2009 at 7:22 PM
Does your splash screen have the same automationID as your main window?
Is the main window already up when the splash screen is shown?  Or does it only come up after the splash screen goes away?
Apr 29, 2009 at 2:05 PM
I don't know about the AutomationID.  I should check that.  How would that help?

The main window isn't up when the splash screen is shown.  What seems to happen is that the splash screen appears, at which point Automation seems to go "There is one window, and it's not the one I want" and gives up.  If it waited another ten seconds (well within the timeout) then it would find it.

If I turn off the splash screen then it does work.  But I'd like to know if there's a way around it that doesn't involve that.
Apr 29, 2009 at 2:24 PM
If the splash screen doens't have the same automationID then the issue isn't so much that splash screen comes up, it's the automation times out before your main window appears.  (If that is what you were trying to say before, sorry I misunderstood). 

In my automation I have had the same thing.  You could always just put in a sleep command (Ex. "Thread.Sleep(10000)" which would pause for 10 seconds), but that is not the optimal way.  I've played with a "WaitWhileBusy" command but I haven't had much luck getting that to work. 

public static Application app = null;
public static Window window = null;

Application.Launch(PATH)  // the path could be the URL (if web app) ex. "public const string PATH = @'http://yourapp'; "
app = Application.Attach("iexplore");
window = app.GetWindow(MAINWINDOW, InitializeOption.NoCache);  // where MAINWINDOW is the name of the window from UISpy

In my automation I actually use the thread.sleep method because it works and it's easy.

Hope that helps some, or at least gives you a point in the right direction.

Mar 25, 2010 at 1:12 PM

I have the same problem (Splash screen shows, rest of app seems to hang).  Even if I put in a lengthy wait the splash screen eventually goes away but the main window of the app never appears.  Anyone solved the splash screen issue?