public class JnlpStart {
public static void main(String[] s) throws IOException, ParseException {
//Desktop launcher
Desktop desktop = Desktop.getDesktop();
try {
desktop.open(new File("C:/Users/username/Downloads/clcmainwbDev.jnlp"));
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
This class will be invoked from:
public class MainFrameTest {
private FrameFixture window;
private Robot robot;
@BeforeClass
public static void setUpOnce() {
FailOnThreadViolationRepaintManager.install();
}
@Before
public void setUp() throws Exception{
ApplicationLauncher.application(JnlpStart.class).start();
robot = BasicRobot.robotWithCurrentAwtHierarchy();
robot.settings().delayBetweenEvents(50);
robot.waitForIdle();
window = findFrame(new GenericTypeMatcher<Frame>(Frame.class) {
protected boolean isMatching(Frame frame) {
return frame.getTitle().contains("CLC Main Workbench") && frame.isShowing();
}
}).using(robot);
}
The problem is that the hierarchy of the robot is empty and therefore, nothing is found as the FrameFixture from which to further test.
Also, I tried:
public class JnlpStart {
public static void main(String[] s){
Process startApplication = Runtime.getRuntime().exec("javaws -Xnosplash \"http:\\myjnlpfilepath.jnlp\"");
}
}
But I encountered the same problem, empty hierarchy!