Hi David,
this works, thanks!
 
Gert
 


From: [email protected]
To: [email protected]; [email protected]
Subject: RE: [Webtest] Non-breaking spaces
Date: Thu, 6 Dec 2012 15:55:43 +0100







Gert,
I noticed that the xpath expression that I gave you has an error in it. This is 
the correct version:
<verifyXPath xpath=”(/html/body/table/tbody/tr[3]/td)[normalize-space(text()) = 
'. . AML' and position()=1]" />
 
I also noticed that there are 4 dots (.)
Therefore:
<verifyXPath xpath=”(/html/body/table/tbody/tr[3]/td)[normalize-space(text()) = 
'. . . . AML' and position()=1]" />
If you copy-paste this it will probably not work.
You have to replace the spaces between the . with a non-breakable space. You do 
this by holding down the Alt key and typing 255 on you numeric keyboard. If you 
release the Alt, you have a nbsp.
 
David
 


From: [email protected] [mailto:[email protected]] On 
Behalf Of Gert Pauwels
Sent: donderdag 6 december 2012 14:36
To: [email protected]
Subject: RE: [Webtest] Non-breaking spaces
 

Hello,
this doesn't seem to work in my webtest. Firebug also returns no matching nodes 
with this xpath.
My search continues for the non-breaking space issue. Here's a new result:
 




expected value

.&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP


actual value

. . . . AML - IUP
 




expected value

.&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP


actual value

. . . . AML - IUP
 




expected value

.&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP


actual value

. . . . AML - IUP
 




expected value

.&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP


actual value

. . . . AML - IUP
 




expected value

.&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP


actual value

. . . . AML - IUP
 




expected value

.&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP


actual value

. . . . AML - IUP
 




expected value

.&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP


actual value

. . . . AML - IUP
 




expected value

.&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP


actual value

. . . . AML - IUP
 




expected value

.&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP


actual value

. . . . AML - IUP

expected value: .&nbsp;.&nbsp;.&nbsp;.&nbsp;AML - IUP
actual value: . . . . AML - IUP
 
And this is rather important as the dots in front of the acronyms actually tell 
me what level this item is in the hierarchy (no dots= top level, 2 dots = level 
1, 4 dots = level 2 etc.).
 
Gert
 




From: [email protected]
To: [email protected]; [email protected]
Subject: RE: [Webtest] Non-breaking spaces
Date: Thu, 6 Dec 2012 12:04:10 +0100

    <verifyXPath 
xpath=("html/body/table/tbody/tr[3]/td)[normalize-space(text()) = '. . AML' and 
position()=1]" />
 


From: [email protected] [mailto:[email protected]] On 
Behalf Of Gert Pauwels
Sent: donderdag 6 december 2012 11:54
To: [email protected]
Subject: [Webtest] Non-breaking spaces
Importance: High
 

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, Itried 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