From which version did you upgrade?

The problem is probably the  : normally current version of WebTest changes   to normal spaces in xpath expressions so you should not have to check for  

Marc.

Deware, Vipin (Cognizant) wrote:
Hi All,

Recently I have installed the WebTest 2.1. But after the upgradation of WebTest, some of the webtests are failing.
I am forwarding small demo code which is used in the webtest.
If I run the given code with previous WebTest release, it is passing. But when I used WebTest 2.1, it is failing.
So I am unable to sort out the solution for it.

The HTML code is -

<!-- verifyTextDemo.html FILE -->

<!DOCTYPE html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Demo code </TITLE>
</HEAD>
<BODY>
<table cellPadding="0" cellSpacing="3" border="1">
<tr><th>Safek.&nbsp;acc.</th>
<th>Order Type</th>
<th>Limit&nbsp;price</th>
<th>Order&nbsp;Status</th>
<th>Channel</th>
<th>Nbr/Nom</th>
<th> Ticker</th>
<th>Avg.&nbsp;Exec.&nbsp;price</th></tr>
<tr><td>0050-350701-95</td>
<td>Buy&nbsp;Open</td>
<td>77.23</td>
<td>Accepted</td>
<td>FrontNet</td>
<td>100</td>
<td>UBSN0X48(CS)</td>
<td>111.256</td></tr>
</table>
</BODY>
</HTML>

The XML code is -

<!-- verifyTextDemo.xml -->

<project name="verifyTextDemo" basedir="." default="main">
<property name="webtest.home" location="C:/Develop_7-0/WebTestCenter/distribution/WebTest" />
  <import file="${webtest.home}/lib/taskdef.xml"/>
  <target name="main">
<webtest name="myTest"> <steps> <invoke
          description="Get the Simple HTML Page"
          url="file://C:/verifyTextDemo.html"/>
        <storeProperty property="order.buyOrSell" value="Buy"/>
<storeProperty property="displayed.order.position" value="Open"/> <storeProperty property="order.kind" value="#{order.buyOrSell}&#x00a0;#{displayed.order.position}"/> <verifyXPath xpath="//tr/td[2]/text()" text="#{order.kind}"/>
      </steps>
    </webtest>
  </target>
</project>


and the failure message is -
<failure message="com.canoo.webtest.engine.StepFailedException: xpath test: //tr/td[2]/text() evaluates to: Buy Open, expected value is: Buy Open, Step: VerifyXPath at C:\verifyTextDemo.xml:13: with (taskName=&quot;verifyXPath&quot;)"/>

Thanks in advance.

Regards,
Vipin Deware

This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly
prohibited and may be unlawful.


_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to