Logo QF-Test

Im Archiv der Mailingliste
wertvolle Antworten finden.

 

Gratis Testen  Download  Kaufen

Thomas Max, QF-Test Training und Support

Tipp für die Recherche in der Mailingliste: Volltextsuche (oben) verwenden.

Thomas Max,
Sr. Software Engineer & Trainer, QFS

2017 bis heute 2016 2015 2014 | 2013 | 2012 | 2011 2010 2009 | 2008 | 2007

(ältere Archiveinträge vor 2007 nicht dargestellt, aber in der Suche enthalten)

Mailingliste - Einträge 2017 bis heute


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

Re: [QF-Test] How to check the status label text after clicking on a button


  • Subject: Re: [QF-Test] How to check the status label text after clicking on a button
  • From: Martin Moser <martin.moser@?.de>
  • Date: Wed, 30 Aug 2017 08:24:13 +0200
  • Delivered-to: qftest-list@?.net

Hi Kevin,

the error message "An event was triggered outside the AWT Event Dispatch
Thread" is no error by QF-Test.
So you should keep your recorded label check. That's the most
appropriate kind of check for this purpose.

The message indicates that there are severe threading issues in your
application.
You should consider to forward this message to your development team
that they should discuss and hopefully fix that issue.

If that issue cannot be fixed you can switch off the thread-checking of
QF-Test by Edit -> Options -> Replay -> Events:
Set the "Error level" combo box of "How to handle events coming from
wrong thread" to warning.

Background information from QF-Test manual:
 It is a rather common mistake in Swing based Java applications to
access GUI components from the wrong thread. Since Swing is not
thread-safe, such calls may only be made from the AWT event dispatch
thread. Otherwise the potential consequences are race conditions,
leading to very subtle and hard-to-debug errors, or deadlocks, freezing
the application and making it unusable. Background information about
this topic is available from
http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html
, specifically the sections on "Initial Threads" and "The Event Dispatch
Thread".
When QF-Test registers an event on a thread other than the AWT event
dispatch thread it issues an error message including a stack trace which
can be useful in fixing the problem. This set of options defines the
severity of the message, whether to perform strict checking and a
maximum for the number of messages to log.
The possible choices for the option "Error level" are "Error" and
"Warning". We strongly suggest that you keep the default setting of
"Error" and make sure that such problems are fixed sooner rather than
later because they represent a serious risk.

Best Regards,
Martin

Am 29.08.2017 um 10:09 schrieb Liu, Kevin (DPTI):
Hi everyone,

I have a search button to do a person query based on last name, by
default, say the status label A has a text ‘please input last name’,
when I entered a non-existing last name and clicked the search button,
the GUI panel rendered text ‘No records found’ in label A.

But when QF-Test executed the check text node (as shown in disabled
state below) or try and catch fragment, it popped up an error stating
‘An event was triggered outside the AWT Event Dispatch Thread’ and
Jython Server script wasn’t executed at all.

So is it possible to check the label text dynamically based on different
searching criteria? If so, how to check the label text?

Jython Server script

rc.check(0, "No records found label invisible", level=rc.ERROR,
report=True, nowrap=False)

An event was triggered outside the AWT Event Dispatch Thread.

This is not a bug in QF-Test, rather the opposite: Herewith QF-Test

informs you about a potentially very serious problem in your application.

Please notify the developers of the application and include the

event and stack-trace information provided below.

For further information, please see section 31.3.3 of the QF-Test manual,

specifically the documentation for the option

Replay->Events->How to handle events coming from the wrong thread.

Details for developers:

Event:
javax.swing.event.ChangeEvent[source=javax.swing.DefaultButtonModel@5969af31]

Stack-trace: java.lang.Exception: Stack dump

                 at
de.qfs.lib.util.Misc.getCurrentStackTrace(Misc.java:1737)

                 at de.qfs.apps.qftest.client.awt.s.a(SourceFile:2272)

                 at
de.qfs.apps.qftest.client.awt.s.stateChanged(SourceFile:1750)

                 at
javax.swing.DefaultButtonModel.fireStateChanged(DefaultButtonModel.java:349)

                 at
javax.swing.DefaultButtonModel.setEnabled(DefaultButtonModel.java:209)

                 at
javax.swing.AbstractButton.setEnabled(AbstractButton.java:2092)

                 at
trelis.presentation.client.AddClientWizard.enableNextButton(AddClientWizard.java:479)

                 at
trelis.presentation.client.AddClientSearchPanelController.doSearch(AddClientSearchPanelController.java:95)

                 at
trelis.presentation.client.AddClientSearchPanel$1.doInBackground(AddClientSearchPanel.java:142)

                 at
trumps.presentation.component.swing.TaskActionListener$2.run(TaskActionListener.java:76)

                 at
au.gov.sa.transport.concurrent.exec.internal.TaskActor.onReceive(TaskActor.java:22)

                 at
akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:167)

                 at akka.actor.Actor$class.aroundReceive(Actor.scala:465)

                 at
akka.actor.UntypedActor.aroundReceive(UntypedActor.scala:97)

                 at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)

                 at akka.actor.ActorCell.invoke(ActorCell.scala:487)

                 at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)

                 at akka.dispatch.Mailbox.run(Mailbox.scala:220)

                 at
akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)

                 at
scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)

                 at
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)

                 at
scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)

                 at
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Regards

Kevin



_______________________________________________
qftest-list mailing list
qftest-list@?.de
https://movement.qfs.de/mailman/listinfo/qftest-list


--
Martin Moser

E: martin.moser@?.de
T: +49 8171 38648-14
F: +49 8171 38648-16

Quality First Software GmbH | www.qfs.de
Tulpenstr. 41 | 82538 Geretsried | Germany
GF Gregor Schmid, Dr. Martina Schmid, Karlheinz Kellerer
HRB München 140833


Videos Downloads Dokumentation Kaufen Gratis Testen