Package com.canoo.webtest.engine

Examples of com.canoo.webtest.engine.StepFailedException


                htmlElement = findFirstTable(context, step);
            } else {
                htmlElement = context.getCurrentHtmlResponse(step).getHtmlElementById(getHtmlId());
            }
            if (!(htmlElement instanceof HtmlTable)) {
                throw new StepFailedException("Found '" + htmlElement.getTagName() +
                        "' element when looking for 'table' element using htmlId " + getHtmlId(), step);
            }
            final HtmlTable table = (HtmlTable) htmlElement;
            return table.getRow(getRow()).getCell(getColumn()).asText();
        }
View Full Code Here


        context.suspendWindowListener();
        final Collection colFailedImagesSrc = checkImages(conversation, currentResponse);
        context.restoreWindowListener();

        if (!colFailedImagesSrc.isEmpty()) {
          final StepFailedException sfe = new StepFailedException(colFailedImagesSrc.size() + " missing image(s) in page "
              + currentResponse.getWebResponse().getRequestUrl());

          final StringBuffer sb = new StringBuffer();
            for (final Iterator iter = colFailedImagesSrc.iterator(); iter.hasNext();) {
                sb.append(iter.next()).append("\r\n ");
            }
            sfe.addDetail("missing images", sb.toString());
            throw sfe;
        }
    }
View Full Code Here

        throw new StepExecutionException(MESSAGE_MISSING_OPTION_IDENTIFIER, this);
      option = findMatchingOption(select);
    }
    else
    {
      throw new StepFailedException("Found " + elt.getTagName() +
        " when looking for select", this);
    }

    if (select.isMultipleSelectEnabled() && !fIsMultiSelect) {
      deselectOtherOptions(select, option);
View Full Code Here

    updateOption(select, option);
  }

  void updateOption(final HtmlSelect select, final HtmlOption option) {
    if (option == null) {
      throw new StepFailedException("No option found matching criteria in select " + select);
    }
    fTargetHelper.setUsername(getUserName());
    fTargetHelper.setPassword(getPassword());
    maybeTarget(option.getPage(), select, option);
  }
View Full Code Here

      if (verifier.verifyStrings(text, option.asText())) {
        LOG.debug("Found option by text: " + option);
        return option;
      }
    }
    throw new StepFailedException("No option element found with text \"" + text + "\"", this);
  }
View Full Code Here

            form = FormUtil.findFormByName(currentResp, fName);
        } else {
            form = FormUtil.findFormByIndex(currentResp, fIndex);
        }
        if (form == null) {
            throw new StepFailedException("Form not found in doc", this);
        }
        context.setCurrentForm(form);
    }
View Full Code Here

    else if (elt instanceof HtmlTextArea) {
      // TODO: use type(...) once HU stops firing onchange after each typed letter
      ((HtmlTextArea) elt).setText(getValue());
    }
    else {
      throw new StepFailedException("Found " + elt.getTagName() + " when looking for input", this);
    }

    ((HtmlPage) elt.getPage()).setFocusedElement(null);
    LOG.debug("Set text for " + elt + " to value " + getValue());
  }
View Full Code Here

   *
   * @param field The field to update
   */
  protected void setField(final HtmlElement field) throws IOException {
    if (!(field instanceof HtmlCheckBoxInput)) {
      throw new StepFailedException("Found " + field.getTagName() + " when looking for checkbox", this);
    }
    final boolean checked = isChecked();
    final HtmlCheckBoxInput checkBox = (HtmlCheckBoxInput) field;
    if (checkBox.isChecked() != checked) {
      checkBox.click();
View Full Code Here

     *
     * @param elt the field to update
     */
    protected void setField(HtmlElement elt) throws IOException {
        if (!(elt instanceof HtmlRadioButtonInput)) {
            throw new StepFailedException("Found " + elt.getTagName() +
                    " when looking for radio button", this);
        }
        ((HtmlRadioButtonInput) elt).click();
    }
View Full Code Here

        final Context context = getContext();
        try {
            filterContent(message);
        }
        catch (final MessagingException e) {
            throw new StepFailedException("Error performing operation: " + e.getMessage(), this);
        }
        finally {
            context.saveResponseAsCurrent(context.getCurrentResponse());
            context.getConfig().setResultpath(getContext().getConfig().getWebTestResultDir());
            context.saveResponseAsCurrent(context.getCurrentResponse());
View Full Code Here

TOP

Related Classes of com.canoo.webtest.engine.StepFailedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.