Is it possible there is some HTML embedded in the text that is not showing
up in the failure  messages?  What happens if you view the source of the
webtest output?

 

--
Jonathan Rosenberg
Founder & Executive Director, Tabby's Place
http://www.tabbysplace.org/

 

 

 

From: [email protected] [mailto:[email protected]]
On Behalf Of Gert Pauwels
Sent: Monday, March 01, 2010 10:02 AM
To: [email protected]
Subject: RE: [Webtest] Handling non-breaking spaces and other stuff

 

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_AlertDetai
ls.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(.,'C
ustomer&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.
<https://signup.live.com/signup.aspx?id=60969>  

  _____  

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

  _____  

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

Reply via email to