[Webtest] selecting xpath for label contents

Janet Gregory Janet Gregory <janet_gregory@shaw.ca>
Mon, 21 Jul 2008 14:59:13 -0600


This is a multi-part message in MIME format.

----3960f0b3555460774e85
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

We are dynamically creating an "OK" button using javascript once we have created a new user.
 
I am using xpath to find the button but am having a problem.  My xpath checker verifies that this string find the right button. 
  //button[@class='x-btn-text' and contains(text(), 'OK')]

However, in webtest, it says button not found. It will execute the test with  just this xpath string 
  //button[@class='x-btn-text' 

In xpath checker, just using that string identifies 5 buttons. I think it is pressing the "cancel" button instead since my verification step fails.
 
Does Webtest not support full xpath expressions? Or should I be using a variation that I'm not aware of.
 
thx,
Janet

----3960f0b3555460774e85
Content-Type: text/html; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

<DIV>We are dynamically creating&nbsp;an "OK" button using javascript&nbsp;once we have created a new user.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I am using xpath&nbsp;to find the button&nbsp;but am having a problem.&nbsp; My xpath&nbsp;checker verifies that this string find the right button. </DIV>
<DIV>&nbsp; //button[@class='x-btn-text' and contains(text(), 'OK')]<BR></DIV>
<DIV>However, in webtest, it says button not found. It&nbsp;will execute the test with&nbsp; just&nbsp;this xpath&nbsp;string </DIV>
<DIV>&nbsp; //button[@class='x-btn-text' <BR></DIV>
<DIV>In xpath&nbsp;checker, just using that string identifies 5 buttons.&nbsp;I think it&nbsp;is pressing the "cancel" button&nbsp;instead since my verification step&nbsp;fails.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Does Webtest&nbsp;not support full xpath&nbsp;expressions? Or should I be using a variation that I'm not aware of.</DIV>
<DIV>&nbsp;</DIV>
<DIV>thx,</DIV>
<DIV>Janet</DIV>

----3960f0b3555460774e85--