Accept (click 'OK' on) whatever popup is present on the page

@param action   - the action occurring
@param expected - the expected result
@param popup    - the element we are interacting with
353505
private void accept(String action, String expected, String popup) {
        try {
            Alert alert = driver.switchTo().alert();
            alert.accept();
        } catch (Exception e) {
            reporter.fail(action, expected, "Unable to click 'OK' on the " + popup + ". " + e.getMessage());
            log.warn(e);
            return;
        }
        reporter.pass(action, expected, "Clicked 'OK' on the " + popup);
    }
1203177
private boolean isSelect(String action, String expected) {
        // wait for element to be displayed
        if (!is.select()) {
            reporter.fail(action, expected, Element.CANT_SELECT + prettyOutput() + NOT_A_SELECT);
            // indicates element not an input
            return false;
        }
        return true;
    }
1136162
protected void openPopup() {

        m_popup.setWidth(475);
        m_popup.setAutoHideEnabled(true);
        m_popup.addCloseHandler(new CloseHandler<PopupPanel>() {

            public void onClose(CloseEvent<PopupPanel> event) {

                closePopupDefault();

            }
        });

        m_popup.addDialogClose(new Command() {

            public void execute() {

                // nothing to do all will be done in onClose();

            }
        });

        if (m_previewHandlerRegistration != null) {
            m_previewHandlerRegistration.removeHandler();

        }
        m_previewHandlerRegistration = Event.addNativePreviewHandler(new CloseEventPreviewHandler());
        m_popup.showRelativeTo(m_colorField);

        m_popup.setModal(false);
        if (m_popup.getWidgetCount() != 0) {
            m_popup.remove(m_popup.getWidget(0));
        }
        CmsColorSelector picker = new CmsColorSelector();
        try {
            picker.setHex(m_textboxColorValue.getText().replace("#", ""));
        } catch (Exception e) {
            // TODO: Auto-generated catch block
        }
        m_popup.add(picker);
        if (m_count == 0) {
            CmsPushButton close = new CmsPushButton();
            CmsPushButton cancel = new CmsPushButton();
            cancel.setText(Messages.get().key(Messages.GUI_CANCEL_0));
            cancel.setTitle(Messages.get().key(Messages.GUI_CANCEL_0));
            close.setText(Messages.get().key(Messages.GUI_OK_0));
            close.setTitle(Messages.get().key(Messages.GUI_OK_0));
            close.addClickHandler(new ClickHandler() {

                public void onClick(ClickEvent event) {

                    closePopup();

                }
            });
            cancel.addClickHandler(new ClickHandler() {

                public void onClick(ClickEvent event) {

                    closePopupDefault();

                }
            });
            m_popup.addButton(cancel);
            m_popup.addButton(close);
            m_count = 1;
        }

        m_xcoordspopup = m_popup.getPopupLeft();
        m_ycoordspopup = m_popup.getPopupTop();

    }
642318
protected void showPopupMenu(MouseEvent e) {
        if (onAboutToShow(e)) {
            JPopupMenu popupToShow = getPopupMenu(e);
            if (popupToShow == null) {
                return;
            }
            popupToShow.show(e.getComponent(), e.getX(), e.getY());
            popupToShow.setVisible(true);
        }
    }
1363790
private void handleActionException(String target, HttpServletRequest request, HttpServletResponse response, Action action, ActionException e) {
		int errorCode = e.getErrorCode();
		String msg = null;
		if (errorCode == 404) {
			msg = "404 Not Found: ";
		} else if (errorCode == 400) {
			msg = "400 Bad Request: ";
		} else if (errorCode == 401) {
			msg = "401 Unauthorized: ";
		} else if (errorCode == 403) {
			msg = "403 Forbidden: ";
		}
		
		if (msg != null) {
			if (log.isWarnEnabled()) {
				String qs = request.getQueryString();
				msg = msg + (qs == null ? target : target + "?" + qs);
				if (e.getMessage() != null) {
					msg = msg + "\n" + e.getMessage();
				}
				log.warn(msg);
			}
		} else {
			if (log.isErrorEnabled()) {
				String qs = request.getQueryString();
				log.error(errorCode + " Error: " + (qs == null ? target : target + "?" + qs), e);
			}
		}
		
		e.getErrorRender().setContext(request, response, action.getViewPath()).render();
	}
104176
protected void onShowPopup(final MouseEvent e)
	{
		if (e.isPopupTrigger())
		{
			System.out.println(e.getSource());
			popupMenu.show(e.getComponent(), e.getX(), e.getY());
		}
	}
442537
public void actionPerformed(ActionEvent e)
    {
        if (e.getSource() == this)
        {
            Date dateTarget = this.getTargetDate();
            JTimePopup popup = JTimePopup.createTimePopup(this.getTimeParam(), dateTarget, this, languageString);
            popup.addPropertyChangeListener(this);
        }
    }
927089
public static <T extends PopupPanel> T showAbove (T popup, Widget target)
    {
        return show(popup, Position.ABOVE, target);
    }
459365
function (passedOffset) {
            var section = this.context.createSection({
                fn : this._renderFullText,
                scope : this
            });

            var popup = new ariaPopupsPopup();
            this._popup = popup;

            popup.$on({
                scope : this,
                "onAfterClose" : this._onAfterPopupClose
            });

            popup.open({
                section : section,
                domReference : this.ellipsisElement,
                preferredPositions : [{
                            reference : "top left",
                            popup : "top left"
                        }],
                closeOnMouseOut : true,
                offset : {
                    top : passedOffset.top,
                    left : passedOffset.left
                }
            });

            popup.domElement.firstChild.onclick = ariaUtilsFunction.bind(this._popup_onmouseclick, this);

            this.callbackID = null;
        }
916255
public void actionPerformed(ActionEvent e)
    {
        if (e.getSource() == this)
        {
            Container container = this.getParent();
            if (container instanceof JCalendarDualField)
                container = container.getParent();
            if (container instanceof JTable)
            {   // Always
                JTable jtable = (JTable)container;
                int iRow = jtable.getSelectedRow();
                Object value = jtable.getValueAt(iRow, m_iColumn);
                this.setControlValue(value);    // Make sure I have the right value
            }
            //Date dateTarget = this.getTargetDate();
            
            JCalendarPopup popup = JCalendarPopup.createCalendarPopup(this.getDateParam(), this.getTargetDate(), this, this.getLanguage());
            popup.setTransferFocus(false);
            popup.addPropertyChangeListener(this);
        }
    }
903960
@UiHandler("m_editButton")
    void editAction(ClickEvent event) {

        m_clipboard.enableFavoritesEdit();
        m_buttonUsePanel.setVisible(false);
        m_buttonEditingPanel.setVisible(true);
    }
1021441
@FXML
    void okButtonOnAction(ActionEvent event) {
        UpdateAvailableDialog t = this;

        okButton.setDisable(true);
        cancelButton.setText(bundle.getString("button.cancel.cancelDownload"));

        downloadThread = new Thread(() -> {
            try {
                boolean res = UpdateChecker.downloadAndInstallUpdate(updateInfo, t);
                if (res) {
                    t.hide();
                }
            } catch (IllegalStateException | IOException e) {
                showErrorMessage(e.getLocalizedMessage());
                e.printStackTrace();
            }
        });
        downloadThread.start();
    }
138617
protected void fireAction(ActionListener action) {
        int      modifiers    = 0;
        AWTEvent currentEvent = EventQueue.getCurrentEvent();

        if (currentEvent instanceof InputEvent) {
            modifiers = ((InputEvent) currentEvent).getModifiers();
        } else if (currentEvent instanceof ActionEvent) {
            modifiers = ((ActionEvent) currentEvent).getModifiers();
        }

        ActionEvent e = new ActionEvent(getComponent(), ActionEvent.ACTION_PERFORMED, getComponent().getText(),
                                        EventQueue.getMostRecentEventTime(), modifiers);

        action.actionPerformed(e);
    }
670018
public void actionToggleElement() throws JspException {

        // set editor values from request
        try {
            setEditorValues(getElementLocale());
        } catch (CmsXmlException e) {
            // an error occurred while trying to set the values, stop action
            showErrorPage(e);
            return;
        }

        // get the necessary parameters to add/remove the element
        int index = 0;
        try {
            index = Integer.parseInt(getParamElementIndex());
        } catch (Exception e) {
            // ignore, should not happen
        }

        if (getAction() == ACTION_ELEMENT_REMOVE) {
            // remove the value , first get the value to remove
            I_CmsXmlContentValue value = m_content.getValue(getParamElementName(), getElementLocale(), index);
            m_content.removeValue(getParamElementName(), getElementLocale(), index);
            // check if the value was a choice option and the last one
            if (value.isChoiceOption()
                && (m_content.getSubValues(
                    CmsXmlUtils.removeLastXpathElement(getParamElementName()),
                    getElementLocale()).size() == 0)) {
                // also remove the parent choice type value
                String xpath = CmsXmlUtils.removeLastXpathElement(getParamElementName());
                m_content.removeValue(xpath, getElementLocale(), CmsXmlUtils.getXpathIndexInt(xpath) - 1);
            }
        } else {
            // add the new value after the clicked element
            if (m_content.hasValue(getParamElementName(), getElementLocale())) {
                // when other values are present, increase index to use right position
                index += 1;
            }
            String elementPath = getParamElementName();
            if (CmsStringUtil.isNotEmpty(getParamChoiceElement())) {
                // we have to add a choice element, first check if the element to add itself is part of a choice or not
                boolean choiceType = Boolean.valueOf(getParamChoiceType()).booleanValue();
                I_CmsXmlSchemaType elemType = m_content.getContentDefinition().getSchemaType(elementPath);
                if (!choiceType || (elemType.isChoiceOption() && elemType.isChoiceType())) {
                    // this is a choice option or a nested choice type to add, remove last element name from xpath
                    elementPath = CmsXmlUtils.removeLastXpathElement(elementPath);
                } else {
                    // this is a choice type to add, first create type element
                    m_content.addValue(getCms(), elementPath, getElementLocale(), index);
                    elementPath = CmsXmlUtils.createXpathElement(elementPath, index + 1);
                    // all eventual following elements to create have to be at first position
                    index = 0;
                }
                // check if there are nested choice elements to add
                if (CmsXmlUtils.isDeepXpath(getParamChoiceElement())) {
                    // create all missing elements except the last one
                    String pathToChoice = CmsXmlUtils.removeLastXpathElement(getParamChoiceElement());
                    String newPath = elementPath;
                    while (CmsStringUtil.isNotEmpty(pathToChoice)) {
                        String createElement = CmsXmlUtils.getFirstXpathElement(pathToChoice);
                        newPath = CmsXmlUtils.concatXpath(newPath, createElement);
                        pathToChoice = CmsXmlUtils.isDeepXpath(pathToChoice)
                        ? CmsXmlUtils.removeFirstXpathElement(pathToChoice)
                        : null;
                        I_CmsXmlContentValue newVal = m_content.addValue(getCms(), newPath, getElementLocale(), index);
                        newPath = newVal.getPath();
                        // all eventual following elements to create have to be at first position
                        index = 0;
                    }
                    // create the path to the last choice element
                    elementPath = CmsXmlUtils.concatXpath(
                        newPath,
                        CmsXmlUtils.getLastXpathElement(getParamChoiceElement()));
                } else {
                    // create the path to the choice element
                    elementPath += "/" + getParamChoiceElement();
                }
            }
            // add the value
            m_content.addValue(getCms(), elementPath, getElementLocale(), index);
        }

        if (getValidationHandler().hasWarnings(getElementLocale())) {
            // there were warnings for the edited content, reset validation handler to avoid display issues
            resetErrorHandler();
        }

        try {
            // write the modified content to the temporary file
            writeContent();
        } catch (CmsException e) {
            // an error occurred while trying to save
            showErrorPage(e);
        }

    }
213768
function addAction(action, ctrl) {
      this.addActionIcon(action, ctrl);
      if (!this.actionExists(action, ctrl)) {
        ctrl.actionListService.requiredActionsList.splice(action.index, 0, action.name);
        ctrl.actionListService.actionsToIndex[action.name] = action.index;
        ctrl.actionListService.onToggle[action.name] = action.onToggle;
        ctrl.actionListService.actionsToDisplay.unshift(action.name);
      }
    }
1344799
public void setAction(String action) throws ApplicationException {
	if (StringUtil.isEmpty(action)) return;
	action = action.toLowerCase().trim();
	if (action.equals("run")) this.action = ACTION_RUN;
	else if (action.equals("delete")) this.action = ACTION_DELETE;
	else if (action.equals("update")) this.action = ACTION_UPDATE;
	else if (action.equals("list")) this.action = ACTION_LIST;
	else if (action.equals("lists")) this.action = ACTION_LIST;
	else if (action.equals("pause")) this.action = ACTION_PAUSE;
	else if (action.equals("resume")) this.action = ACTION_RESUME;
	else throw new ApplicationException("attribute action with value [" + action + "] of tag schedule is invalid",
		"valid attributes are [delete,run,update,list,resume,pause]");
    }
64968
public void click() {
    assertElementNotStale();
    assertElementDisplayed();

    parent.getScopeServices().captureOperaIdle();

    if (getTagName().equals("OPTION")) {
      callMethod("return " + OperaAtom.CLICK + "(locator)");
    } else {
      parent.getMouse().click(getCoordinates());
    }

    try {
      parent.waitForLoadToComplete();
    } catch (ResponseNotReceivedException e) {
      // This might be expected
      logger.fine("Response not received, returning control to user");
    }
  }