Groovy webtest throttling at context root in url invoke

I'm trying to wrap my head around the canoo website

I am setting up a simple groovy web test. I even did and run the xml equivalent and I get the same error when it tries to encode the url.

I am getting an error when using the context root. I don't get an error when I just use the url without the context root.ie."http://somesite.com"

In addition to having extra letters, etc. there is another forward slash, but apparently a stupid bytecode decoder can handle forward slashes with http: // part ... Why not just as simple as a directory

I would have thought a website would be able to handle something as simple as a directory on the site or the context root, or at least define and encode data correctly. Loading any type of URL will be of paramount importance if you are writing an application called "Web".

invoke(url: "http://somesite.com/CONTEXTRoot", description: "Load dev java site")
verifyTitle("Title to check")

      

or

<?xml version="1.0" ?>
<!DOCTYPE project SYSTEM "../dtd/Project.dtd">
<project default="test">
    <target name="test">
        <webtest name="check login and welcome page load and work">
            <invoke description="Go to dev site" 
                    url="http://devsite.com/CONTEXTRoot/" />                
            <clickButton label="Enter Application" />
        </webtest>
    </target>
</project>

      

StackTrace:

E:\canoo\WebSiteFunctionalTests\tests\WebSiteWebTest.xml:11: Unexpected exception caught: sun.io.MalformedInputException
at com.canoo.webtest.steps.StepUtil.handleException(StepUtil.java:120)
at com.canoo.webtest.steps.Step.handleException(Step.java:379)
at com.canoo.webtest.steps.Step.execute(Step.java:110)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    ...
  Caused by: sun.io.MalformedInputException
    at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:262)
    at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:314)
    at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:364)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:250)
    at java.io.InputStreamReader.read(InputStreamReader.java:212)
    at org.cyberneko.html.HTMLScanner.load(HTMLScanner.java:1166)
    at org.cyberneko.html.HTMLScanner.read(HTMLScanner.java:1127)
    at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1913)
    at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:893)
    at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:495)
    at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:448)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:680)
    at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:240)
    at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:127)
    at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)
    at com.canoo.webtest.engine.Configuration$2.createPage(Configuration.java:655)

      

+1


source to share


1 answer


I got it to work on the call when I changed the meta and page tag in my jsp

from

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

      



to

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">

      

I posted a JIRA error about this as the error only occurs during the call and not on the submit and click link form.

0


source







All Articles