[Webtest] selecting xpath for label contents

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Thu, 24 Jul 2008 09:49:03 +0200

Hi Janet,

WebTest has full xpath support. Are you sure that you're OK button has
been created at the time you want to check it? If yes, can you provide
the html code on which you find that WebTest has xpath problems?

Blog: http://mguillem.wordpress.com

Janet Gregory wrote:
> 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