RE: Non-breaking spaces

David Jehoul <[email protected]>
Newsgroups gmane.comp.web.canoo.webtest
Message-ID <36E5382C105BCF4DA127E661672BCF9B1FB67291@br4-mail>
    <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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.