Hi all,
 
Returned to using Canoo after a year or so and I’m struggling a bit with a 
webtest on a page that contains non-breaking spaces.
Here’s what I do in the webtest:
 
<verifyXPath xpath="html/body/table/tbody/tr[4]/td[1]" 
text=".&amp;nbsp;.&amp;nbsp;.&amp;nbsp;.&amp;nbsp;AML - IUP"/>
 
The actual html page I’m testing displays the text as follows: 
 
. . . . AML – IUP
 
But if you look in the page source, this is what you get:
 
.&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP
 
Knowing that my webtest would fail on the ‘&’ symbol, I tried escaping that in 
the XPath verification. But this still keeps failing. 
 
Using canoo 3.0, htmlunit 2.9. Also tried reverting back to htmlunit 2.4, to no 
avail.
 
Another question, also related to the above: 
 
    <verifyXPath xpath="html/body/table/tbody/tr[3]/td[normalize-space(text()) 
= '. . AML']" />

In an attempt to resolve the non-breaking space issue, I tried to use the 
normalize space function. The problem here is that canoo does not find the node 
I'm doing it on. I need it to be tthe first TD within the 3rd table row, but I 
don't know how to indicate the TD number and use the normalize space function 
AT THE SAME TIME. Even if this function is not the solution to my nbsp issue, 
I'm still curious to find out how I can do the 2 things in parallel (indication 
which node and use a function at the same time).
 
Any ideas?
Gert                                      

Reply via email to