Package com.canoo.webtest.engine

Examples of com.canoo.webtest.engine.StepFailedException


      fieldNames.add(field.getName());
    }
   
    if (fieldNames.size() != getCount())
    {
      throw new StepFailedException(buildFailureMessage(), getCount(), fieldNames.size());
    }
  }
View Full Code Here


                setWebtestProperty(getProperty(), String.valueOf(row + 1), getPropertyType());
                return;
            }
            row++;
        }
        throw new StepFailedException("No cells were found matching '"+getText()+"' starting from " + cellReference.formatAsString(), this);
    }
View Full Code Here

          if (!exists)
            sb.append("not ");
          sb.append("exist");
          if (actualValue != null)
            sb.append(" (actual value: >" + actualValue + "<");
        throw new StepFailedException(sb.toString(), this);
      }
    }
    else
    {
      final boolean regex = ConversionUtil.convertToBoolean(getRegex(), false);
      if (!getVerifier(regex).verifyStrings(getValue(), actualValue))
      {
        throw new StepFailedException("Wrong info property value for key \"" + getKey() + "\"", getValue(), actualValue);
      }
    }
  }
View Full Code Here

     */
    public void doExecute() throws Exception {
        final String strTitle = getContext().getCurrentHtmlResponse(this).getTitleText();

        if (!verifyText(strTitle)) {
            throw new StepFailedException("Wrong document title found!", getText(), strTitle, this);
        }
    }
View Full Code Here

            final String expectedValue = "SUM(" + getRange() + ")".toUpperCase();
            final String actualValue = excelCell.getCellFormula().toUpperCase();
            if (verifyStrings(expectedValue, actualValue)) {
                return;
            }
            throw new StepFailedException("Unexpected formula in cell " + getCellReferenceStr(), expectedValue, actualValue);
        }
        else if (excelCell.getCellType() != HSSFCell.CELL_TYPE_NUMERIC) {
            throw new StepFailedException("Cell " + getCellReferenceStr() + " does not contain a formula or a numeric value.");
        }
    }
View Full Code Here

    }

    private void extractMultiPartMessage(final Multipart parts, final int partIndex) throws MessagingException {
        try {
            if (partIndex >= parts.getCount()) {
                throw new StepFailedException("PartIndex too large.", this);
            }
            final BodyPart part = parts.getBodyPart(partIndex);
            final String contentType = part.getContentType();
            if (!StringUtils.isEmpty(getContentType()) && !contentType.equals(getContentType())) {
                throw new MessagingException("Actual contentType of '" + contentType +
View Full Code Here

            data = uudc.decodeBuffer(byteStream);
        } catch (IOException e) {
            throw new MessagingException("Error Uudecoding attachment: " + e.getMessage());
        }
        if (StringUtils.isEmpty(fContentType)) {
            throw new StepFailedException("Attribute 'contentType' must be supplied for simple messages.", this);
        }
        defineAsCurrentResponse(data, getContentType());
    }
View Full Code Here

                    continue;
                }
                if (excelCellAt.getCellType() == HSSFCell.CELL_TYPE_NUMERIC) {
                    sum += excelCellAt.getNumericCellValue();
                } else {
                    throw new StepFailedException("Cell " + ((char) ('A' + col)) + (row + 1) + " does not contain a numeric value.");
                }
            }
        }
        if (Math.abs(cellValue - sum) > 0.01) {
            throw new StepFailedException("Unexpected sum of cells from range " + fRange + " in cell " + getCellReferenceStr(),
                String.valueOf(sum), String.valueOf(cellValue));
        }
    }
View Full Code Here

                    fFilename = line.substring(lastSpace + 1);
                }
            }
        }
        if (buf.length() == 0) {
            throw new StepFailedException("Unable to find part with index " + partIndex + ".");
        }
        LOG.debug("buf=" + buf.toString());
        return buf.toString().getBytes();
    }
View Full Code Here

        }
        else {
            elt = StoreElementAttribute.findElement(getContext().getCurrentResponse(), getHtmlId(), null, LOG, this);
        }
        if (!verifyText(readText(elt))) {
            throw new StepFailedException(getFailedMessage(), getText(), readText(elt), this);
        }
  }
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.