Package com.canoo.webtest.engine

Examples of com.canoo.webtest.engine.StepFailedException


    public void doExecute() {
        final Cookie[] cookies = StoreCookie.getCookies(getContext());
        LOG.debug("Found " + cookies.length + " cookie(s)");
        if (cookies.length == 0) {
            throw new StepFailedException("No cookie available!", this);
        }
        for (int i = 0; i < cookies.length; i++) {
            Cookie cookie = cookies[i];
            if (cookie.getName().equals(getName())) {
                // just check for existence of cookie if no text given
                if (getText() == null) {
                    return;
                }
                if (verifyText(cookie.getValue())) {
                    return;
                }
                throw new StepFailedException("Wrong cookie \"" + getName() + "\" value found!",
                    getText(), cookie.getValue(), this);
            }
        }
        throw new StepFailedException("Cookie \"" + getName() + "\" not set!", this);
    }
View Full Code Here


          ok = getVerifier(true).verifyStrings(getText(), text);
        else
          ok = (text.indexOf(getText()) > -1);
       
        if (!ok)
          throw new StepFailedException("Text not found in pdf text \"" + text + "\"");
  }
View Full Code Here

    public void doExecute() throws Exception {
        final String cellValue = getCellValue();
        if (verifyStrings(getText(), cellValue)) {
            return;
        }
        throw new StepFailedException("Wrong cell value found for cell "+
                getCellReferenceStr(), getText(), cellValue, this);
    }
View Full Code Here

            else {
                for (final Iterator frames = allFrames.entrySet().iterator(); frames.hasNext();) {
                  final Map.Entry frame = (Map.Entry) frames.next();
                    LOG.error(frame.getKey() + " -> " + ((URL) frame.getValue()).toExternalForm());
                }
                throw new StepFailedException("The applet didn't showDocument in " + fTarget);
            }
        }
        return null;
    }
View Full Code Here

    private AppletPluginArguments setUpAppletPluginArguments() throws XPathExpressionException {
        final HtmlPage currentResponse = getContext().getCurrentHtmlResponse(this);
        final HtmlElement appletNode = (HtmlElement) getContext().getXPathHelper().selectFirst(currentResponse, getXpath());
        if (appletNode == null) {
            throw new StepFailedException("The specified element <" + getXpath() + "> was not found.", this);
        }

        final AppletPluginArguments appletPluginArguments = createAppletPluginArguments();
        appletPluginArguments.setAppletTag(extractAppletParameter(currentResponse.getWebResponse().getRequestUrl(), appletNode));
        return appletPluginArguments;
View Full Code Here

    AbstractAppletTag extractAppletParameter(final URL url, final HtmlElement appletNode) {
        try {
            return AbstractAppletTag.newInstance(url, appletNode);
        } catch (Exception e) {
            throw new StepFailedException(e.getMessage(), this);
        }
    }
View Full Code Here

        return apr;
    }

    void verifyAppletResult(AppletPluginResults apr) {
        if (apr.getException() != null) {
            throw new StepFailedException(apr.getException(), this);
        }
        if (apr.getJemmyException() != null) {
            throw new StepFailedException(apr.getJemmyException(), this);
        }
        if (!ZERO.equals(apr.getReturnValue())) {
            throw new StepFailedException("Scenario returns " + apr.getReturnValue(), this);
        }
    }
View Full Code Here

     */
    void appendToClasspath(Class aClass, final Path classpath) {
        if (!appendOptionalToClasspath(aClass.getName(), classpath)) {
            String msg = "Can't locate required class " + aClass.getName();
            LOG.error(msg);
            throw new StepFailedException(msg, this);
        }
    }
View Full Code Here

  }
 
  protected void verifyPdf(final PDFPage pdfPage) {
    final int actualCount = pdfPage.getNumberOfPages();
    if (getCount() != actualCount)
      throw new StepFailedException("Wrong number of pages", getCount(), actualCount);
  }
View Full Code Here

        }
        fBaseHost = htmlPage.getWebResponse().getRequestUrl().getHost();
        final WebClient client = context.getWebClient();
        checkVisits(client, htmlPage);
        if (!fFailedVisits.isEmpty()) {
            throw new StepFailedException(fFailedVisits.size() + " broken link(s): " + brokenLinksToString(), 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.