How to use Container in find operation in Jemmy library?

122 Views Asked by At

Can anyone give explanation and an example of Container usage?

E.g. I am trying to find JProgressBar, and all the find method has Container as the first param.:

JProgressBar pb = JProgressBarOperator.findJProgressBar([Container cont]);

I supposed that JFrame or JDialog etc. could be used (cast) as Container, but it is not. So what is it?

1

There are 1 best solutions below

0
Ivan Gerasimenko On BEST ANSWER

The solution is to get Container of parent element by .getContentPane():

JFrameOperator mf = new JFrameOperator("Main Frame");
JDialogOperator jd = new JDialogOperator(mf, ""); // dialog that contains JProgressBar has no name
JProgressBar pb = JProgressBarOperator.findJProgressBar(jd.getContentPane());