I don't know what happened to Gregg's and my comments.
Again: I appreciate the link to my blog (from the article.) But, I don't believe any current Swing testing tool can work with JavaFX without any changes. Although JavaFX supports Swing components, the component hierarchy is completely different.
Hmm... I just said that it worked :). Atleast the examples that are on the page I referred. When I started on this, I expected some amount of trouble and was pleasantly surprised that it worked without any changes.
I think the difference between the Fest and Marathon is that Marathon posts the events to the system event queue, where as Fest is using Robot.
Aha! good point! by using AWT events you bypass all the node/component hierarchy and get directly to the component. I'll like to see more examples of Marathon though. I'm taking back my "vote down"...
Thanks. BTW, I observed the component#getLocationOnScreen returns proper values where as getLocation returns (0,0). Might be of use for Robot to actually click.
I had to use the coordinates from the node containing the Swing component. Quick question, how do you simulate drag and drop using AWT events? I could only do it with the AWT Robot.
So, Marathon implements a minimal drag and drop using TransferHandler (The Cut&Paste mechanism). The DnD event is recorded by listening for the events, but the actual DnD happens using a different mechanism. This also precludes from recording and playing DnD events from outside the application. I know of some applications specifically implementing Cut&Paste so that they can record DnD using Marathon.
Talking about component hierarchy, Does JavaFX has any other built-in controls other than TextBox? I was playing around with TextBox to get the contents and found that it is quite complicated. In the end, I got to search the whole component hierarchy to get the handle for SGText and get the content.
And also, since we can expect lots of custom components (I saw two progress bars already) is there anything that the component developers add to the components so that the testing tools can support them? Over this weekend, I will take a look at this again.
Comments
alruiz15 replied ago:
I don't know what happened to Gregg's and my comments.
Again: I appreciate the link to my blog (from the article.) But, I don't believe any current Swing testing tool can work with JavaFX without any changes. Although JavaFX supports Swing components, the component hierarchy is completely different.
dk38335 replied ago:
Hmm... I just said that it worked :). Atleast the examples that are on the page I referred. When I started on this, I expected some amount of trouble and was pleasantly surprised that it worked without any changes.
I think the difference between the Fest and Marathon is that Marathon posts the events to the system event queue, where as Fest is using Robot.
alruiz15 replied ago:
Aha! good point! by using AWT events you bypass all the node/component hierarchy and get directly to the component. I'll like to see more examples of Marathon though. I'm taking back my "vote down"...
dk38335 replied ago:
Thanks. BTW, I observed the component#getLocationOnScreen returns proper values where as getLocation returns (0,0). Might be of use for Robot to actually click.
alruiz15 replied ago:
I had to use the coordinates from the node containing the Swing component. Quick question, how do you simulate drag and drop using AWT events? I could only do it with the AWT Robot.
dk38335 replied ago:
I also tried it and you can't :(
So, Marathon implements a minimal drag and drop using TransferHandler (The Cut&Paste mechanism). The DnD event is recorded by listening for the events, but the actual DnD happens using a different mechanism. This also precludes from recording and playing DnD events from outside the application. I know of some applications specifically implementing Cut&Paste so that they can record DnD using Marathon.
dk38335 replied ago:
Talking about component hierarchy, Does JavaFX has any other built-in controls other than TextBox? I was playing around with TextBox to get the contents and found that it is quite complicated. In the end, I got to search the whole component hierarchy to get the handle for SGText and get the content.
And also, since we can expect lots of custom components (I saw two progress bars already) is there anything that the component developers add to the components so that the testing tools can support them? Over this weekend, I will take a look at this again.
Voters For This Link (3)
Voters Against This Link (3)