NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
andvicoso
Joined: 20 Nov 2008 Posts: 42
|
Posted: Tue Jun 05, 2012 1:59 pm Post subject: Jemmy JDialogOperator do not find JDialog |
|
|
Hello all,
I've been struggling with this problem for a long time and I can't find an answer over the internet, so I'm trying it here.
I'm using Jemmy and JellyTools to create functional tests for my suite application. I have a modal JDialog that appears after a ActionNoBlock call from the main menu. But JDialogOperator don't find it. I'm sure the title is correct and I've tried to find it by index too, without success.
I've seen over the web that this problem can be associated with the running thread, but the ActionNoBlock call should resolve this issue, right?
The documentation is very poor. Can somebody help me?
Thanks in advance
[]'s |
|
| Back to top |
|
 |
andvicoso
Joined: 20 Nov 2008 Posts: 42
|
Posted: Tue Jun 05, 2012 3:09 pm Post subject: |
|
|
This is not what I wanted, but solved my problem.
I solved it using a brute force algorithm:
| Code: |
public static JDialogOperator getDialogOperator(final String pTitle) {
try {
Thread.currentThread().sleep(DEFAULT_WAIT_TIME);//500 or 1000
} catch (InterruptedException ex) {
}
JDialog d = null;
for (final Window w : Window.getWindows()) {
if (w instanceof JDialog) {
final JDialog dTemp = (JDialog) w;
if (dTemp.getTitle().equals(pTitle)) {//or equalsIgnoreCase
d = dTemp;
break;
}
}
}
if (d != null) {
return new JDialogOperator(d);
}
return null;
}
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|