[Webtest] How to find string with variable number of embedded spaces?

Paul King Paul King <paulk@asert.com.au>
Thu, 18 Jan 2007 19:56:22 +1000


... and make sure you have regex='true' set if you haven't done that already.

Paul.

Michael Habbert wrote:
> Hi Tim,
> 
> I would suggest: "OCA\sTR\sNational/Brand\sOverrides". If the number of 
> spaces is more than 1 you should insert "\s*" for one or more spaces.
> Watch out for Newline and CarriageReturn.
> 
> mfg
> Michael Habbert
> 
> Tim Miller wrote:
>> Hi,
>>
>>  
>>
>> Here is the problem... @{obj.name} is "OCA TR National/Brand 
>> Overrides” but html source is “OCA TR       National/Brand Overrides”. 
>> There can be x number of spaces in the middle and between any of the 
>> word. What would be the best way to look for the string?
>>
>>  
>>
>> Thank a lot...
>>
>> Olivia
>>
>>  
>>
>> Webtest fragment
>>
>>  
>>
>>    <ifStep>
>>
>>         <condition>
>>
>>             <not>
>>
>>                   <verifyText text="@{obj.name}" regex="true" />
>>
>>             </not>
>>
>>         </condition>
>>
>>         <echo message="@{obj.name}&#xD;&#xA;" file="${ObjNotFound}" 
>> append="true"/>
>>
>>    </ifStep>
> [...]
>> Html source
>>
>>                             <td valign="top" align="left" width="31%">
>>
>>                               <a 
>> href="/edgedynamics/portal/parameterdetail.do?parameterName=OCA_TR_NB_OVERRIDE" 
>> title="Name">OCA TR       National/Brand Overrides</a>
>>
>>                             </td>
> [...]
>>
>> (This email message is for the sole use of the intended recipient(s) 
>> and may contain confidential information.  Any unauthorized review, 
>> use, disclosure or distribution is prohibited.  If you are not the 
>> intended recipient, please contact the sender by reply email and 
>> destroy all copies of the original message.)
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> 
>