Hi,
This almost worked. It seems that the code you gave took all the whitespace
from the XPath I stored so the result is Odottaapakettia as it should be
Odottaa pakettia. But I think that this is good enough because if I put
Odottaapakettia as expected result the test fails only if the test fails
also with Odottaa pakettia (which means "waiting for a package" in finnish
in case you wondered).
Thank you very much.
-Juho
Guillaume Richard wrote:
>
> Hi,
> this answer may not be suitable for you, but I experienced myself such
> problems (which where caused by the website, not webtest BTW). You can see
> below how I deal with those:
>
> <storeXPath xpath="/my/X/path" property='fileName'/>
> <groovy description="Format fileName property for suitable test">
> def props = step.webtestProperties
> def fname = props.fileName
> fname = (fname =~ /[^a-zA-Z0-9]/).replaceAll("")
> props.putAt("fileName", fname)
> </groovy>
>
> <verifyProperty name="fileName" text="my text to match"/>
>
>
> Basically, I store my value, treat it in a groovy step to keep only
> alpha-numeric characters, then compare it in a verifyProperty step.
>
> Hope it can help...
>
> Regards,
> Guillaume
>
>
> 2010/8/26 mascis <[email protected]>
>
>>
>> Hi,
>>
>> I have an element I have to check with verifyXPath but there seems to be
>> a
>> problem with verifyXPath.
>> I uploaded two screenshots mixed in one small picture that hopefully
>> explains itself.
>> In upper part of the picture is the XPath of the element and the result
>> what
>> View Xpath gives for it and what it should look like. In the lower part
>> is
>> what Webtest gives. For some reason it leaves a weird space in front of
>> the
>> text that should be verified and the test fails because of that. Adding
>> space in front of the expected result won't help.
>>
>> http://old.nabble.com/file/p29541802/xpath.png xpath.png
>> --
>> View this message in context:
>> http://old.nabble.com/A-problem-with-verifyXPath-tp29541802p29541802.html
>> Sent from the WebTest mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> WebTest mailing list
>> [email protected]
>> http://lists.canoo.com/mailman/listinfo/webtest
>>
>
>
--
View this message in context:
http://old.nabble.com/A-problem-with-verifyXPath-tp29541802p29550524.html
Sent from the WebTest mailing list archive at Nabble.com.
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest