/** * This method is designed to choose a menu item and wait for a dialog window to be opened. * The method also activates a retry mechanism until the dialog is successfully opened. * * @param windowName * The window that holds the menu (Label of the window) * @param buttonName * The menu item name to be selected * @param mainWindow * The dialog window that will be opened. * @throws Exception */ public DialogOperator chooseMenuItemAndWaitForDialog( JFrameOperator mainFrame, String menuName, String menuItemName, String dialogName) throws Exception { chooseMenuItem(mainFrame, menuName, menuItemName); JDialogOperator dialog = new JDialogOperator(dialogName); if (!dialog.isActive()) { report("The Dialog " + dialogName + " was not opened successfully. is visible = " + dialog.isVisible()); Thread.sleep(1000); report("The Dialog " + dialogName + " after 1 second sleep active = " + dialog.isActive() + " is visible = " + dialog.isVisible()); } else { report("The Dialog " + dialogName + " was opened successfully"); } return dialog; }
/** * push a button in a given container and wait for the dialog to open * * @param operator * the operator to find the button in * @param buttonName * the name of the button to push * @param dialogName * the dialog that should appear * @return the JDialogOperator of the requested dialog or null if not opened * * @throws Exception */ public JDialogOperator pushButtonAndWaitForDialog( ContainerOperator operator, String buttonName, String dialogName) throws Exception { pushButton(operator, (Object) buttonName); JDialogOperator dialog = new JDialogOperator(dialogName); if (dialog == null || !dialog.isActive()) { report("The Dialog " + dialogName + " was not opened successfully", Reporter.WARNING); return null; } report("The Dialog " + dialogName + " was opened successfully"); return dialog; }
btn.push(); JDialogOperator dialog = new JDialogOperator(windowName); if (!dialog.isActive()) { this.report("The Dialog " + windowName + " was not opened successfully. is visible=" Thread.sleep(1000); this.report("The Dialog " + windowName + " after 1 second sleep active= " + dialog.isActive() + " is visible=" + dialog.isVisible()); } else {