I had a small Problem
how can wait for a dialog to be shown
There seems to be the only possibility to "wait
for FrameShowing" - but what about "...DialogShowing"?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Same thing. Consider "frame" in this case to mean "window with a title". The argument is the title of the frame or dialog (regular expressions are accepted).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wrote a simple Dialog. Abbot shows the 'Dialog and I can record some actions. But to be able to replay the actions I need to insert a wait method call. The FrameShowing method seems to be the best for my purposes but when it is invoked, it aborts with the following error message:
Failure: 10000ms exceeded, Wait for FrameShowing(test2) in step 'Wait for FrameShowing(test2)'
The call works very well for frames and applications,
but it fails when invoked on a dialog.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had a small Problem
how can wait for a dialog to be shown
There seems to be the only possibility to "wait
for FrameShowing" - but what about "...DialogShowing"?
Same thing. Consider "frame" in this case to mean "window with a title". The argument is the title of the frame or dialog (regular expressions are accepted).
I wrote a simple Dialog. Abbot shows the 'Dialog and I can record some actions. But to be able to replay the actions I need to insert a wait method call. The FrameShowing method seems to be the best for my purposes but when it is invoked, it aborts with the following error message:
Failure: 10000ms exceeded, Wait for FrameShowing(test2) in step 'Wait for FrameShowing(test2)'
The call works very well for frames and applications,
but it fails when invoked on a dialog.
Your dialog is titled "test2", I presume? And it does appear?
Is it a Dialog or a JDialog?
yes my JDialog is titeled"test2"
Could you post the code you're testing?
The 0.6.1 release will fail to match some titles if they contain regular expression characters, but that is certainly not the case with "test2".
Is the dialog displaying when the test fails?
Thanx the workaround works fine
my code
package as1;
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
/**
* <p>berschrift: </p>
* <p>Beschreibung: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Organisation: </p>
* @author unbekannt
* @version 1.0
*/
public class Test2 extends JDialog {
JPanel panel1 = new JPanel();
XYLayout xYLayout1 = new XYLayout();
JLabel jLabel1 = new JLabel();
public Test2(Frame frame, String title, boolean modal) {
super(frame, title, modal);
try {
jbInit();
pack();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
public Test2() {
this(null, "Testfenster2", false);
}
void jbInit() throws Exception {
panel1.setLayout(xYLayout1);
jLabel1.setText("jLabel1");
getContentPane().add(panel1);
panel1.add(jLabel1, new XYConstraints(161, 133, -1, -1));
}
public static void main(String[] args) {
try {
}
catch(Exception e) {
e.printStackTrace();
}
Test2 test2 = new Test2(null,"test2",false);
test2.setVisible(true);
}
and yes, the dialog is showin wenn the Test fails
This is fixed in CVS.
A workaround for 0.6.1 is to make a dummy frame which is the parent of your dialog, instead of passing in "null" as the parent.