[Webtest] verifyXPath

Mark McKeown Mark McKeown <Mark.McKeown@aepona.com>
Thu, 14 Dec 2006 14:46:37 +0000


Hi Marc,

we discovered the problem. In the DOM inspector the @title attribute seems to map to a nodeName of 'fancytooltips' (the 
javascript we are using for tooltips). When we use the following the test passes okay

xpath="//div[@id='formTable']/form/fieldset[1]/label/a[@fancytooltip='test tooltip.']"/>

Thanks for your help.

Mark


Marc Guillemot wrote:
> Are you sure that there is no special character involved? You can try to 
> ask WebTest to print the @title value for instance making a verifyXPath 
> step to fail.
> 
> Marc.
> 
> Mark McKeown wrote:
>> Hi Marc,
>>
>> to clarify, the error was:
>>
>> failed with message "xpath test: 
>> //div[@id='formTable']/form/fieldset[1]/label/a[@title='test 
>> tooltip.'] matched no nodes"
>>
>> I was trying some different combinations to try and discover why it 
>> would not work!
>>
>> Any thoughts/ideas?
>>
>> Mark
>>
>> Marc Guillemot wrote:
>>> Did you really try with the XPath you show? The error message 
>>> indicates something else ('test' rather than 'test tooltip.').
>>>
>>> Marc.
>>>
>>> Mark McKeown wrote:
>>>> Hi Guys,
>>>>
>>>> I have a fragment of html:
>>>>
>>>> <a title="test tooltip." href="1#">
>>>>
>>>> which I am trying to verify the XPath of.
>>>>
>>>> If I use:
>>>>
>>>> //div[@id='formTable']/form/fieldset[1]/label/a[@href='1#']
>>>> then the XPath verifies ok.
>>>>
>>>> However if I try:
>>>>
>>>> //div[@id='formTable']/form/fieldset[1]/label/a[@title='test tooltip.']
>>>> then CANOO reports:
>>>> failed with message "xpath test: 
>>>> //div[@id='formTable']/form/fieldset[1]/label/a[@title='test'] 
>>>> matched no nodes"
>>>>
>>>> I am using the title attribute to specify a mouse-over tooltip on a 
>>>> piece of text. Are there any restrictions in XPath here which I may 
>>>> not be aware of? Can anyone suggest a solution?
>>>>
>>>> Thanks in advance,
>>>> Mark
>>>>
>>>> _______________________________________________
>>>> WebTest mailing list
>>>> WebTest@lists.canoo.com
>>>> http://lists.canoo.com/mailman/listinfo/webtest
>>>>
>>>
>>> _______________________________________________
>>> WebTest mailing list
>>> WebTest@lists.canoo.com
>>> http://lists.canoo.com/mailman/listinfo/webtest
>>
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest

-- 

Dr Mark McKeown         Email: mark.mckeown@aepona.com
Software Engineer       Phone: +44 (0)28 9026 9115
AePONA Ltd,             Fax:   +44 (0)28 9026 9111
Interpoint Building,    www:   www.aepona.com
20-24 York Street,
Belfast BT15 1AQ