benjamin84 / fest

Automatically exported from code.google.com/p/fest
0 stars 0 forks source link

new FrameFixture(robot, (Frame) null) #149

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using version 1.0a1 of the FEST-Swing module.

I had some problems with dialog lookup. Sometimes a dialog wasn't found. At
first I thought that it's a timing issue. Then I've put a long delay just
before looking up the dialog, the dialog showed on screen, but it still
could not be found. Finally I discovered that the dialog was constructed
without an owner (with null).
I used a frame fixture for getting a fixture for the dialog and the problem
was that the dialog wasn't part of the frame's containment hierarchy. I
checked this with Swing Explorer.

I solved the issue by constructing the frame fixture with a null target:
  FrameFixture frame = new FrameFixture(robot, (Frame) null);
and it worked.

Is this a feature? I mean, using a ComponentFinder#findByType(root, type)
with a root of null makes sense, but constructing a FrameFixture for null
doesn't seem so.

Original issue reported on code.google.com by csaba.ju...@gmail.com on 10 Jun 2008 at 11:45

GoogleCodeExporter commented 9 years ago
Quick question, have you tried using WindowFinder? (more details at
http://fest.easytesting.org/swing/wiki/pmwiki.php?n=FEST-Swing.LongDurationTasks
 ).
Please let us know if you already tried and if it couldn't help your use case. 
To
better understand the problem you are describing, is it possible you can please
provide us a test case? :)

Many thanks,
-Alex

Original comment by Alex.Rui...@gmail.com on 10 Jun 2008 at 12:52

GoogleCodeExporter commented 9 years ago

Hi Alex,

I haven't tried using WindowFinder, but I'm looking forward to.

Regarding the issue, the problem I had was that I constructed the dialog like:
new JDialog(null)
i.e., without any owner, and I used a FrameFixture to find it, like:
frameFixture.dialog()
The problem is that I had to construct the FrameFixture without a target, like:
FrameFixture frameFixture = new FrameFixture(robot, null)

My question is whether it is normal to construct a fixture without a target or 
not.

Thanks,
Csabi

Original comment by csaba.ju...@gmail.com on 10 Jun 2008 at 2:18

GoogleCodeExporter commented 9 years ago
Hi Csabi,

Actually the fixture should not be constructed without a target. I think we 
need to
add something like an IllegalArgumentException if a null target is passed.

I'm going to file an issue to add this validation.

Quick question, from your e-mail address I can tell your name is Csaba Juhos. 
Would
you mind if I add you to the list of contributors? We appreciate the feedback 
you
have given us! :)

Regards,
-Alex

Original comment by Alex.Rui...@gmail.com on 10 Jun 2008 at 2:45

GoogleCodeExporter commented 9 years ago

Hi Alex,

My name is Juhos Csaba-Zsolt and would appreciate if you added me as a 
contributor.
And about the feedback, there is definitely more to come.

BR,
Csabi

Original comment by csaba.ju...@gmail.com on 12 Jun 2008 at 8:41

GoogleCodeExporter commented 9 years ago
Closed. WindowFinder is the solution.

Original comment by Alex.Rui...@gmail.com on 18 Jun 2008 at 10:29

GoogleCodeExporter commented 9 years ago
Set the module as a label, instead of being part of the title.

Original comment by Alex.Rui...@gmail.com on 1 Dec 2008 at 2:01