[Webtest] encoding problem

Renato Gasparelli Cavalcante webtest@lists.canoo.com
Tue, 04 May 2004 18:25:09 -0300


    Hi

    I have a test case that need to use the '' symbol (hex:B5), but
seems to me, that webtest convert it to '?' symbol (hex:3F). Does anyone
know what can i do to solve this problem?

    I have made a sample to show my point. Look the stretches below:
        google.xml (input file) : <setinputfield name="q" value="" />,
        result.xml (result file) : <parameter name="value" value="?"/>,
        lastResponse...html (google last response file) :
http://images.google.com/images?q=%3F&...

    I am passing '' to webtest and webtest is returning me the '?' symbol.

file: google.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="google" default="main" >
 


        <target name="main">
                <testSpec name="google">
                        <config host="www.google.com"
                                port="80"
                                protocol="http"
                                basepath="/"
                                haltonfailure="false"
                                haltonerror="false"
                                summary="true"
                                resultpath="."
                                resultfile="results.xml"
                                verbose="true"
                                saveresponse="true"
                                showhtmlparseroutput="false"/>
 


                        <steps>
                                <invoke url="ncr" />
                                <setinputfield name="q" value="" />
                                <clickbutton name="btnG"/>
                        </steps>
 


                </testSpec>
        </target>
 


        <property name="webtest.home"
value="/var/tmp/renatogc/workspace/test.webtest/original" />
 


        <taskdef file="${webtest.home}/webtestTaskdefs.properties">
                <classpath>
                        <pathelement path="${webtest.home}/lib"/>
                        <fileset dir="${webtest.home}"
includes="**/lib/*.jar"/>
                </classpath>
        </taskdef>
 


</project>

file: result.xml
...
            <step>
                <parameter name="value" value="?"/>
                <parameter name="stepId" value="&lt;unknown>"/>
                <parameter name="name" value="q"/>
                <parameter name="stepType" value="setinputfield"/>
                <result>
                    <completed duration="3"/>
                </result>
            </step>
...

link found in one of the lastResponse file:
"http://images.google.com/images?q=%3F&hl=en&lr=&ie=UTF-8&oe=ISO-8859-1&sa=N&tab=wi"