[Webtest] setInputField: Why can I add more then maxlength characters
Willi Kuhnis
Willi Kuhnis" <wkuehnis@gmail.com
Wed, 9 Jan 2008 08:14:49 +0100
------=_Part_24811_32741857.1199862889881
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
I want to check the maxlength of a input-field.
I have a Input-field like this:
<input class="coolborder" name="RemoteDir" type="text" size="40"
maxlength="40" value="">
**** First I fill a variable with a string of the maxlength (40)
<var name="x" value=""/>
<repeat count="${maxlength}">
<var name="x" value="M${x}"/>
</repeat>
<echo>${x}</echo>
************* Then I fill in this variable to the Input field
<setInputField value="${x}" name="${name}" description="Set editfield
${name} to a length of ${maxlength} : ${x}"/>
<clickButton label="Submit" description="Press the submit button for
${name}"/>
******* Then I check the content -> this has to be OK
<verifyInputField value="${x}" name="${name}" description="check if the
Inputfield has still the same content"/>
***** Now I add one more character to my variable and enter this I the input
field
<var name="x" value="${x}+"/>
<echo>${x}</echo>
<setInputField value="${x}" name="${name}" description="Set editfield
${name} to maxlength+1 ${x}"/>
******* When I test the content of the Inputfield, then I get 41
characters-> this should not be possible!!
<storeInputFieldAttribute name="${name}" property="valnew"
attributeName="value" description="Get the value"/>
<echo>"my value 1="</echo>
<echo>"#{valnew}"</echo>
******* Also verifyInputField say, that the field contents all the 41
characters -> this should be not possible
<verifyInputField value="${x}" name="${name}" description="check:the
Inputfield must not have the same content"/>
What can I do ?
Thanks for a help
Willi
--
Willi Kuhnis
wkuehnis@gmail.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------=_Part_24811_32741857.1199862889881
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
<pre><span style="">Hi,</span></pre><pre><span style=""><br></span></pre><pre><span style="">I want to check the maxlength of a input-field.</span></pre><pre><span style="">I have a Input-field like this:</span></pre><pre>
<span style=""><<span class="start-tag">input</span><span class="attribute-name"> class</span>=<span class="attribute-value">"coolborder" </span><span class="attribute-name">name</span>=<span class="attribute-value">
"RemoteDir" </span><span class="attribute-name">type</span>=<span class="attribute-value">"text" </span><span class="attribute-name">size</span>=<span class="attribute-value">"40" </span><span class="attribute-name">
maxlength</span>=<span class="attribute-value">"40" </span><span class="attribute-name">value</span>=<span class="attribute-value">""</span>></span></pre><span style=""> </span>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""> </span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style="">**** First I fill a variable with a string of the maxlength (40)</span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><var name="x" value=""/></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><repeat count="${maxlength}"></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><span style=""> </span><var name="x"
value="M${x}"/><span style=""> </span></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""></repeat></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><echo>${x}</echo></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style="">************* Then I fill in this variable to the Input field</span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><setInputField value="${x}" name="${name}"
description="Set editfield ${name} to a length of ${maxlength} :
${x}"/></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><clickButton label="Submit" description="Press the
submit button for ${name}"/></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""> </span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style="">******* Then I check the content -> this has to be OK</span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><verifyInputField value="${x}" name="${name}"
description="check if the Inputfield has still the same content"/></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""> </span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style="">***** Now I add one more character to my variable and enter this I the
input field</span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><var name="x" value="${x}+"/><span style=""> </span></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><echo>${x}</echo></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><setInputField value="${x}" name="${name}"
description="Set editfield ${name} to maxlength+1 ${x}"/><span style=""> </span></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""> </span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style="">******* When I test the content of the Inputfield, then I get 41
characters-> this should not be possible!!</span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><storeInputFieldAttribute name="${name}" property="valnew"
attributeName="value" description="Get the value"/><span style=""> </span></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><echo>"my value 1="</echo></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><echo>"#{valnew}"</echo><span style=""> </span><span style=""> </span><span style="">
</span><span style=""> </span></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""> </span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style="">******* Also verifyInputField say, that the field contents all the 41
characters -> this should be not possible</span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><verifyInputField value="${x}" name="${name}"
description="check:the Inputfield must not have the same
content"/><span style=""> </span></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""> </span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style="">What can I do ?</span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style="">Thanks for a help</span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style="">Willi</span></p>
<p class="MsoNormal" style="line-height: 13pt;"><span style=""> </span></p>
-- <br>Willi Kuhnis<br><a href="mailto:wkuehnis@gmail.com">wkuehnis@gmail.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------=_Part_24811_32741857.1199862889881--