[Webtest] setInputField: Why can I add more then maxlength characters

Robert Bodziony Robert Bodziony" <robert.bodziony@gmail.com
Wed, 9 Jan 2008 13:25:44 +0100


------=_Part_1198_28234070.1199881544351
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hi
 i got same issue. i think that SetInputField method doesne care ab
maxlength or size parameter :(

  Regards,

 Robert



2008/1/9, Willi Kuhnis <wkuehnis@gmail.com>:
>
> 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_1198_28234070.1199881544351
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hi <br>&nbsp;i got same issue. i think that SetInputField method doesne care ab maxlength or size parameter :( <br><br>&nbsp; Regards,<br><br>&nbsp;Robert<br><br><br><br><div><span class="gmail_quote">2008/1/9, Willi Kuhnis &lt;<a href="mailto:wkuehnis@gmail.com">
wkuehnis@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><pre><span>Hi,</span></pre><pre><span><br></span></pre><pre>
<span>I want to check the maxlength of a input-field.</span></pre><pre><span>I have a Input-field like this:</span></pre><pre><span>&lt;<span>input</span><span> class</span>=<span>&quot;coolborder&quot; </span><span>name</span>
=<span>
&quot;RemoteDir&quot; </span><span>type</span>=<span>&quot;text&quot; </span><span>size</span>=<span>&quot;40&quot; </span><span>
maxlength</span>=<span>&quot;40&quot; </span><span>value</span>=<span>&quot;&quot;</span>&gt;</span></pre><span> </span>

<p style="line-height: 13pt;"><span>&nbsp;</span></p>

<p style="line-height: 13pt;"><span>**** First I fill a variable with a string of the maxlength (40)</span></p>

<p style="line-height: 13pt;"><span>&lt;var name=&quot;x&quot; value=&quot;&quot;/&gt;</span></p>

<p style="line-height: 13pt;"><span>&lt;repeat count=&quot;${maxlength}&quot;&gt;</span></p>

<p style="line-height: 13pt;"><span><span>&nbsp;&nbsp;&nbsp; </span>&lt;var name=&quot;x&quot;
value=&quot;M${x}&quot;/&gt;<span> </span></span></p>

<p style="line-height: 13pt;"><span>&lt;/repeat&gt;</span></p>

<p style="line-height: 13pt;"><span>&lt;echo&gt;${x}&lt;/echo&gt;</span></p>

<p style="line-height: 13pt;"><span>************* Then I fill in this variable to the Input field</span></p>

<p style="line-height: 13pt;"><span>&lt;setInputField value=&quot;${x}&quot; name=&quot;${name}&quot;
description=&quot;Set editfield ${name} to a length of ${maxlength} :
${x}&quot;/&gt;</span></p>

<p style="line-height: 13pt;"><span>&lt;clickButton label=&quot;Submit&quot; description=&quot;Press the
submit button for ${name}&quot;/&gt;</span></p>

<p style="line-height: 13pt;"><span>&nbsp;</span></p>

<p style="line-height: 13pt;"><span>******* Then I check the content -&gt; this has to be OK</span></p>

<p style="line-height: 13pt;"><span>&lt;verifyInputField value=&quot;${x}&quot; name=&quot;${name}&quot;
description=&quot;check if the Inputfield has still the same content&quot;/&gt;</span></p>

<p style="line-height: 13pt;"><span>&nbsp;</span></p>

<p style="line-height: 13pt;"><span>***** Now I add one more character to my variable and enter this I the
input field</span></p>

<p style="line-height: 13pt;"><span>&lt;var name=&quot;x&quot; value=&quot;${x}+&quot;/&gt;<span>&nbsp; </span></span></p>

<p style="line-height: 13pt;"><span>&lt;echo&gt;${x}&lt;/echo&gt;</span></p>

<p style="line-height: 13pt;"><span>&lt;setInputField value=&quot;${x}&quot; name=&quot;${name}&quot;
description=&quot;Set editfield ${name} to maxlength+1 ${x}&quot;/&gt;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>

<p style="line-height: 13pt;"><span>&nbsp;</span></p>

<p style="line-height: 13pt;"><span>******* When I test the content of the Inputfield, then I get 41
characters-&gt; this should not be possible!!</span></p>

<p style="line-height: 13pt;"><span>&lt;storeInputFieldAttribute name=&quot;${name}&quot; property=&quot;valnew&quot;
attributeName=&quot;value&quot; description=&quot;Get the value&quot;/&gt;<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>

<p style="line-height: 13pt;"><span>&lt;echo&gt;&quot;my value 1=&quot;&lt;/echo&gt;</span></p>

<p style="line-height: 13pt;"><span>&lt;echo&gt;&quot;#{valnew}&quot;&lt;/echo&gt;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>

<p style="line-height: 13pt;"><span>&nbsp;</span></p>

<p style="line-height: 13pt;"><span>******* Also verifyInputField say, that the field contents all the 41
characters -&gt; this should be not possible</span></p>

<p style="line-height: 13pt;"><span>&lt;verifyInputField value=&quot;${x}&quot; name=&quot;${name}&quot;
description=&quot;check:the Inputfield must not have the same
content&quot;/&gt;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>

<p style="line-height: 13pt;"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>

<p style="line-height: 13pt;"><span>&nbsp;</span></p>



<p style="line-height: 13pt;"><span>What can I do ?</span></p>



<p style="line-height: 13pt;"><span>Thanks for a help</span></p>



<p style="line-height: 13pt;"><span>Willi</span></p>

<p style="line-height: 13pt;"><span>&nbsp;</span></p>

-- <br><span class="sg">Willi Kuhnis<br><a href="mailto:wkuehnis@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">wkuehnis@gmail.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
</span></blockquote></div><br>

------=_Part_1198_28234070.1199881544351--