2018 up to now | 2017 | 2016 | 2015 | 2014 | 2013 | 2012 | 2011 | 2010 | 2009 | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

Mailing List - Entries of 2011

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QF-Test] "wait for component" for multiple components

  • Subject: Re: [QF-Test] "wait for component" for multiple components
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: Thu, 29 Sep 2011 14:01:14 +0200

Hello Robbie,

if the application actually freezes while it is busy - i.e. the
resulting action is performed on the event dispatch thread - the
solution is simple: QF-Test will not perform the step following the
button press until the dispatch thread is free again. Take a look at
the run-log for the case when the error dialog appears. What's the
real-time used for the button press? If it's several seconds, matching
the time it took for the error dialog to appear, you can set the
timeout for the 'Wait for component' for the error dialog to 0.

If the operation is performed in a background thread and QF-Test tries
to execute the wait immediately after pressing the button, you can
implement some form of polling loop, e.g.

+ Loop 10 iterations
  + Try
    + Wait for component (error dialog, timeout 0)
    + Handle dialog
    + Break
    + Catch ComponentNotFoundException
  + Try
    + Wait for component (other component) / Check some attribute - timeout 0
    + Break
    + Catch ComponentNotFoundException or CheckFailedException
  + Empty sequence "Delay", post delay 1000
  + Else
    + ... you'll get here if the loops ends without a break, i.e.
      neither condition is fulfilled, so you can log an error or throw
      an exception

Best regards,

"Toyota, Robbie" <RToyota@?.com> writes:

> Hello,
> I am running QF-Test on a program that communicates with a server when a button is pressed, and
> the response time can vary from nearly immediate to 10 seconds.
> When the button is pressed, it freezes the application (on purpose), and then when it receives a
> response, the program will either respond again, or it will have a little pop up window with an
> error message.
> What I’m currently doing is doing a “wait for component” (inside a “try” block) for the pop up
> window, with a timeout of 10 seconds. I want to know if I can optimize this in any way, since the
> test would be able to continue after, for example, 1 second, when the program responds again with
> no error message. The only way I can think of to do this, would be to do something like “wait for
> component: [the pop up] OR [whatever button I press next in the test case]”. Is anything like this
> possible?
> I hope that made sense. If not, I can try explain it in a different way.
> Thanks for any input,
> Robbie

Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                               Tel: +49 8171 38648-0
DE-82538 Geretsried                         Fax: +49 8171 3864816
GF: Gregor Schmid, Karlheinz Kellerer          HRB München 140833