Hi Will,

thanks for you help. Unfortunately, the webtest still fails even though the 
expected and the actual value 'look' the same:

 

Message
Wrong result for xpath >/html/body/table/tbody/tr[1]/td/ul/li[wt:cleanText(a)]<

Location
C:\PROJECTS-FUNCTIONAL\CANOO\CanooWebTest\_DNBNOR\tests\cm_screen_AlertDetails.xml
 (line: 14)


Details




expected value
Alert details

actual value
Alert details

expected value Alert details

actual value Alert details


Gert





expected value
Alert details

actual value
Alert details


From: [email protected]
To: [email protected]
Subject: Re: [Webtest] Handling non-breaking spaces and other stuff
Date: Mon, 1 Mar 2010 08:50:46 -0600

My second suggestion would return true for Customer Address details.  You might 
be able to put a not() in there but then the xpath is getting pretty unweildy.

My last suggestion is wt:cleanText() which is not part of the standard xpath 
functions but, I think, a webtest added one:
//li[wt:cleanText(a)='Customer details']

Otherwise I don't know sorry :(

Will




 
Hi,
 
yes, they are in a table, and this is the xpath that I am using (with your 
suggestion in it):
 
<verifyXPath description="Verify Caption Top Section" 
xpath="normalize-space(/html/body/table/tbody/tr[2]/td/ul/li/a[contains(.,'Customer&amp;nbsp;details')])"
 text="Customer details"/>

I need to be absolutely certain that the caption I write in text="New Alerts" 
is the exact caption that Canoo finds, because I may also have captions like 
Customer Address details, Customer Account details etc. Would your suggestions 
also be returning 'true' for those captions? If so, then I cannot use them. 
Is there any possibility to remove the non-breaking space and replace it with a 
'regular' space?
 
Gert 
 


From: [email protected]
To: [email protected]
Subject: Re: [Webtest] Handling non-breaking spaces and other stuff
Date: Mon, 1 Mar 2010 08:26:57 -0600

I'm assuming the text you supplied is in a table just so my below xpath 
statements are correct.  The suggestions I have are in the brackets.

Have you tried:
//td[contains(.,'Customer&amp;nbsp;details')]

How about this workaround:
//td[contains('Customer') and contains('details')]




 
Hi,
 
I seem to be stumbling upon other issues as I advance in my webtests. Have any 
of you had to deal with nbsp's in your webpage tests?
 
I need to click links that are displayed as Customer details but webtests fail 
on the caption because in the source page they are written as 
"Customer&nbsp;details".
 
How can I handles these appropriately?
 
Gert



Hotmail: Free, trusted and rich email service. Get it now. 


Hotmail: Powerful Free email with security by Microsoft. Get it now.            
                          
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969

Reply via email to