Loading ...
Sorry, an error occurred while loading the content.

646Re: Waiting for application response

Expand Messages
  • pkaluski
    Nov 16, 2004
      Hi,
      Thanks for the response. I am afraid that IsWindowEnabled is not
      going to help me. To my knowledge based on some experiments,
      IsWindowEnabled returns control's property, which decides if the
      control should or should not accept input. It does not give you
      information that control is not able to accept any input because the
      the application is busy doing something else.
      --Piotr

      --- In perlguitest@yahoogroups.com, Darren Blee <d_blee@y...> wrote:
      >
      >
      > There is a windows function called IsWindowEnabled.
      > If it is not available via GUI Test, and I assume from
      > these threads that it is not, then you could use the
      > Win32::API module to call it.
      >
      > BOOL IsWindowEnabled(
      > HWND hWnd // handle of window to test
      > );
      >
      > It takes as an argument the window handle and returns
      > a boolean as to if windows believes the program can
      > recieve input or not. If the cursor is not an
      > hourglass then this function will not help (as windows
      > has not been told by the app that it is not ready to
      > recieve input).
      >
      > Note that a child window receives input only if it is
      > both enabled and visible. There is a IsWindowVisible
      > function as well but I doubt that you'll need it.
      >
      > Dennis however makes a good point. If the GUI has no
      > other visual indicators then you have to create some.
      >
      > - Darren
      >
      > --- "Dennis K. Paulsen" <ctrondlpaulsden@y...>
      > wrote:
      >
      > ---------------------------------
      >
      >
      > Hello,
      >
      > Here are a few thoughts...
      >
      > > What to do when some GUI operations take time (which
      >
      > > manifests in most cases by a hourglass and by not
      > reacting on any
      > > input).
      >
      > I suppose many of us don't have much control over such
      > poorly
      > written programs. :-( Usually, a well built GUI
      > application will
      > always & easily keep the user "in the loop" and not
      > just show an
      > hourglass and restrict input, for example a status-bar
      > or
      > appropriate messaging usually suffices...
      >
      > In cases such as yours, we generally need to look for
      > some change in
      > the GUI, i.e. text, disabling/enabling of a button, a
      > new window,
      > etc.... If its text, a for-loop and
      > WMGetText/GetWindowText usually
      > does the job, if its a button use IsWindowEnabled, and
      > if its a new
      > window, WaitWindowLike (note: default timeout of 10
      > can easily be
      > overridden) will get the job done...
      >
      > >The way many people workaround this right now, is
      > that they place a
      > >sleep in their script. Function WaitWindowLike works
      > this way. My
      > > question is - is there a Win32 mechanism/function
      > allowing to get
      > > information if application is waiting for input or
      > is it in the
      > > middle of something.
      >
      > There shouldn't be too many cases where a sleep
      > statement still
      > needs to be used... WaitWindowLike only uses a delay
      > (500ms select
      > statement) in order not to "bog down" the system....
      >
      >
      > And a GUI application is usually always waiting for
      > input and always
      > doing something (processing messages, etc.), so that
      > generally
      > doesn't help.... Historically, the highly pristine
      > method is to
      > wait for a GUI change; which is *the* solution to use
      > if your intent
      > is to -test- a particular application...
      >
      > Regards,
      > D
      >
      > --- In perlguitest@yahoogroups.com, "pkaluski"
      > <pkaluski@p...> wrote:
      > >
      > > OK. Maybe I was not clear enough. Application works
      > fine. My
      > question
      > > is more general. What to do when some GUI operations
      > take time
      > (which
      > > manifests in most cases by a hourglass and by not
      > reacting on any
      > > input). If your test script will not give tested
      > application some
      > > time to recover, it will fail on finding some new
      > windows or
      > controls
      > > which were expected to appear once the GUI operation
      > is complete.
      > The
      > > way many people workaround this right now, is that
      > they place a
      > sleep
      > > in their script. Function WaitWindowLike works this
      > way. My
      > question
      > > is - is there a Win32 mechanism/function allowing to
      > get
      > information
      > > if application is waiting for input or is it in the
      > middle of
      > > something.
      > > --Piotr
      > >
      > > --- In perlguitest@yahoogroups.com, ab dk
      > <cazaawi@y...> wrote:
      > > >
      > > > It sounds like you have to re-establishe the
      > focus.
      > > > It could be that your application is waiting for
      > an event that
      > does
      > > not happen. I hope this could be helpful.
      > > >
      > > > pkaluski <pkaluski@p...> wrote:
      > > >
      > > > Hi,
      > > > My automated test contains a part when I populate
      > one field and
      > > then
      > > > as a result another control is populated. It takes
      > time (10 - 15
      > > > seconds). Cursor disappears and the application
      > does not accept
      > any
      > > > input. Currently my workaround is that I am doing
      > a long sleep.
      > Is
      > > > there a more civilized way of finding out if
      > application is
      > ready
      > > to
      > > > receive more input?
      > > >
      > > > --Piotr
      > > > www.piotrkaluski.com
      > > > www.guiautomation.com
      > > >
      > > >
      > > >
      > > >
      > > >
      > > > Yahoo! Groups SponsorADVERTISEMENT
      > > >
      > > >
      > > > ---------------------------------
      > > > Yahoo! Groups Links
      > > >
      > > > To visit your group on the web, go to:
      > > > http://groups.yahoo.com/group/perlguitest/
      > > >
      > > > To unsubscribe from this group, send an email
      > to:
      > > > perlguitest-unsubscribe@yahoogroups.com
      > > >
      > > > Your use of Yahoo! Groups is subject to the
      > Yahoo! Terms of
      > > Service.
      > > >
      > > >
      > > >
      > > > [Non-text portions of this message have been
      > removed]
      >
      >
      >
      >
      > Yahoo! Groups Sponsor ADVERTISEMENT
      >
      >
      > ---------------------------------
      > Yahoo! Groups Links
      >
      > To visit your group on the web, go to:
      > http://groups.yahoo.com/group/perlguitest/
      >
      > To unsubscribe from this group, send an email to:
      > perlguitest-unsubscribe@yahoogroups.com
      >
      > Your use of Yahoo! Groups is subject to the Yahoo!
      > Terms of Service.
      >
      >
      > Find local movie times and trailers on Yahoo! Movies.
      > http://au.movies.yahoo.com
    • Show all 11 messages in this topic