[Webtest] VerifyText: How to handle nbsp?

John and Pip John and Pip" <pipandjohn@gmail.com
Tue, 19 Dec 2006 23:13:31 +1300


------=_Part_1551_30323104.1166523211459
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi All,

VerifyText does not work in the most intuitive way (from my non-techie point
of view). It is called verifyText not verifyHTML but it actually seems to do
the latter.

This is a particular problem for nbsp e.g. my page appears to say "Confirm
Password" but the HTML is actually "Confirm&nbsp;Password:".

If I put <verifyText text="Confirm Password:"/>  it fails but if I put the
horrible <verifyText text="Confirm&nbsp;Password:"/> it also fails! With the
result showing:
                <parameter name="taskName" value="verifyText"/>
                <parameter name="text" value="ConfirmPassword:"/>
                <result>
                    <failed duration="15"/>
                </result>

1) Is there a workaround that will let me handle nbsp somehow, perhaps
similar to the way I have to handle strings of text that have a word bolded
where I would put for example <verifyText text="&lt;b&gt;Check:&lt;/b&gt;
have you filled in all sections marked"/>?

2) Can anything be done to improve this, because verifyText is really the
key validation tool for beginners / non-techie users and this behaviour is
at best confusing. Hopefully I've just missed something (see note re web
site below). I think the ideal solution is for verifyText to strip out all
tags from the target and to replace all nbsp with a simple space before
comparison. I believe WebTest uses HTMLUnit which uses NekoHTML to convert
the html to xml, so I guess it would have to hook in here or just after this
process as the whole page would need to be converted into a true text
version if verifyText was to work the way I think it should...?

Any advice would be most appreciated.

regards,
        john

------=_Part_1551_30323104.1166523211459
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi All,<br><br>VerifyText does not work in the most intuitive way (from my non-techie point of view). It is called verifyText not verifyHTML but it actually seems to do the latter.<br><br>This is a particular problem for nbsp 
e.g. my page appears to say &quot;Confirm Password&quot; but the HTML is actually &quot;Confirm&amp;nbsp;Password:&quot;. <br><br>If I put &lt;verifyText text=&quot;Confirm Password:&quot;/&gt;&nbsp; it fails but if I put the horrible &lt;verifyText text=&quot;Confirm&amp;nbsp;Password:&quot;/&gt; it also fails! With the result showing:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter name=&quot;taskName&quot; value=&quot;verifyText&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter name=&quot;text&quot; value=&quot;ConfirmPassword:&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;failed duration=&quot;15&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/result&gt;<br><br>1) Is there a workaround that will let me handle nbsp somehow, perhaps similar to the way I have to handle strings of text that have a word bolded where I would put for example &lt;verifyText text=&quot;&amp;lt;b&amp;gt;Check:&amp;lt;/b&amp;gt; have you filled in all sections marked&quot;/&gt;?
<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>2) Can anything be done to improve this, because verifyText is really the
key validation tool for beginners / non-techie users and this behaviour
is at best confusing. Hopefully I&#39;ve just missed something (see note re
web site below). I think the ideal solution is for verifyText to strip out all tags from the target and to replace all nbsp with a simple space before comparison. I believe WebTest uses HTMLUnit which uses NekoHTML to convert the html to xml, so I guess it would have to hook in here or just after this process as the whole page would need to be converted into a true text version if verifyText was to work the way I think it should...?
<br><br>Any advice would be most appreciated.<br><br>regards,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; john<br>
<br>

------=_Part_1551_30323104.1166523211459--