Logo QF-Test

Finding valuable answers
in the Mailing List Archive.

 

Free Trial  Download  Buy

Thomas Max, QF-Test training and support

Use the full-text search on our web site to find helpful tips on the mailing list.

Thomas Max, 
Sr. Software Engineer & Trainer, QFS

2017 up to now  | 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 2007


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

Re: [QF-Test] Blocking Tests on purpose until user reacts


  • Subject: Re: [QF-Test] Blocking Tests on purpose until user reacts
  • From: "Wiesner Stephan" <stephan.wiesner@?.ch>
  • Date: Fri, 20 Jul 2007 08:05:27 +0200

Thanks, that would be a solution, though not quite what we need (non technical user, does not want to have to enter anything).
We run our smoke tests on all our systems, including the production system. Therefore we need a pop up to make sure that the user (who ist usually not a tester) acknowledges that he knows he is working with real data. Just a reminder really.

I started by trying to do it in Jython (example from the tutorial below) but that did not block my tests.
from javax import swing
import sys
f = swing.JFrame(sys.argv[1], size=(200,200),
defaultCloseOperation=swing.JFrame.EXIT_ON_CLOSE)
f.contentPane.add(swing.JLabel(sys.argv[2]))
f.visible = 1


It does work if I write my own Java class, however, which is fine for me. So, problem solved.


package ...;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 * Die Klasse öffnet einen Informationsdialog. Die Tests warten auf Bestätigung
 * durch den User, bis sie weiter fortfahren.
 *
 * @author Stephan Wiesner
 *
 */
public class InfoGui {

	public InfoGui() {	}

	/*
	 * Erzeugt einen Modal dialog mit Ja/Nein/Abbrechen
	 */
	public boolean acceptQuestion(String question) {
		JFrame frame = new JFrame(question);
		frame.setVisible(true);
		int answer = JOptionPane.showConfirmDialog(frame, question);
		boolean result = false;
		if (answer == JOptionPane.YES_OPTION) {
			result = true;
		}
		else result = false;
		frame.setVisible(false);
		frame.dispose();
		return result;
	}
}


Freundliche Grüsse,
Stephan Wiesner

__________________________________________________
Testmanager ESTM
Telefon +41 (0)31 551 78 68

RTC Real-Time Center AG
Schwarzenburgstr. 160
3097 Liebefeld
__________________________________________________


-----Ursprüngliche Nachricht-----
Von: Gregor Schmid [mailto:Gregor.Schmid@?.de]
Gesendet: Donnerstag, 19. Juli 2007 12:51
An: qftest-list@?.de
Cc: Wiesner Stephan
Betreff: Re: [QF-Test] Blocking Tests on purpose until user reacts


Hello Stephan,

of course you could write a Jython server script to do that, but
there's a much more simple way: Use an interactive 'Set variable' node
for a dummy variable. You can specify an arbitrary text for the
message. Please see the manual for details about other options like
timeout.

Best regards,
    Greg



Videos Downloads Documentation Buy Free Trial