[Webtest] verifyXPath fails on R_882

Denis N. Antonioli webtest@lists.canoo.com
Tue, 28 Jun 2005 22:07:50 +0200


Hi Tim

I would think that this is a big in one of the underlying library,  
but I'm not entirely convinced.
Who has an authoritative opinion on this? Marc?

In between, you may try with the normalize-space function of xpath:

//tr[normalize-space(td)='2.1'][normalize-space(td)='2.2']/td[3]

That may be the faster, if not the more elegant, solution.

Best
     dna

On 28 juin 05, at 18:44, Tim Miller wrote:

> Any ideas on how to proceed with this problem? We do not have control
> over what the app sends us in a table.
>
> Tim
>
>
> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com] On Behalf Of Tim Miller
> Sent: Friday, June 24, 2005 12:14 PM
> To: webtest@lists.canoo.com
> Subject: RE: [Webtest] verifyXPath fails on R_882
>
> Denis,
>
> Could it be that Jaxen is now more in alignment with the spec? WebTest
> R_825 uses jaxen-1.0-FCS-full.jar and R_882 is using
> jaxen-1.1-beta-6.jar. I'm sure there is a good reason to be using the
> beta.
>
> Tim
>
>
> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com] On Behalf Of Denis N. Antonioli
> Sent: Friday, June 24, 2005 11:02 AM
> To: webtest@lists.canoo.com
> Subject: Re: [Webtest] verifyXPath fails on R_882
>
> Hi Tim
>
> indeed, when I insert a new line in my test document, the test fails
> too.
>
> Now is time to go look at the specification, see how it should
> behave ;-)
>
> Nice weekend
>      dna
>
>
> On 24 juin 05, at 17:52, Tim Miller wrote:
>
>
>> Denis,
>>
>> I pulled the following out of the actual page. I noticed that there
>> is a
>> return before the '76071-1' value. Could this be causing a problem?
>>
>>
>> Order and Analysis summary for each line item in the order:<BR>
>> <table border="1" cellspacing="0" cellpadding="1">
>>   <tr>
>>     <th>OrdLineNum</th>
>>     <th>ProdId</th>
>>
>>     <th>ProdDesc</th>
>>     <th>Ndc</th>
>>     <th>OrdQty</th>
>>     <th>UnitPrice</th>
>>     <th>MinOrdQty</th>
>>     <th>OrdUnitQty</th>
>>
>>     <th>EdgeRecCode</th>
>>     <th>EdgeRecQty</th>
>>     <th>EdgeRndRecQty</th>
>>     <th>EdgeRecMethod</th>
>>   </tr>
>>   <tr>
>>     <td>
>>
>>       76071-1
>>     </td>
>>     <td>
>>       76071
>>     </td>
>>     <td>
>>       Prestall Ap 100mg
>>     </td>
>>     <td>
>>       90543300071
>>     </td>
>>
>>     <td>
>>       1000
>>     </td>
>>     <td>
>>       179.17
>>     </td>
>>     <td>
>>       0
>>     </td>
>>     <td>
>>
>>       1
>>     </td>
>>     <td>
>>       NR
>>     </td>
>>     <td>
>>       1000
>>     </td>
>>     <td>
>>       1000
>>     </td>
>>
>>     <td>
>>       NA
>>     </td>
>>   </tr>
>> </table><BR>
>>
>>
>>
>> -----Original Message-----
>> From: webtest-admin@lists.canoo.com
>> [mailto:webtest-admin@lists.canoo.com] On Behalf Of Denis N.  
>> Antonioli
>> Sent: Friday, June 24, 2005 6:45 AM
>> To: webtest@lists.canoo.com
>> Subject: Re: [Webtest] verifyXPath fails on R_882
>>
>> Hi Tim
>>
>> I tried to reproduce your bug with following minimal html page:
>>
>> <html><body>
>>      <table>
>>          <tr><td>1.1</td><td>1.2</td><td>1.3</td></tr>
>>          <tr><td>2.1</td><td>2.2</td><td>2.3</td></tr>
>>      </table>
>> </body></html>
>>
>> And the parameters
>> xpath = "//tr[td='2.1'][td='2.1']/td[3]"
>> text =  "2.3"
>>
>>
>> To no avail, the it doesn't break.
>>
>> How does your html page differ from the simple version I'm using?
>>
>> Best
>>      dna
>>
>>
>> On 24 juin 05, at 01:59, Tim Miller wrote:
>>
>>
>>
>>> Any idea why verifyXPath does not work when moving from R_825 to
>>> R_882? All of my verifyXPath steps now fail.  The only thing that
>>> changed was the WebTest version. Below is one sample step.
>>>
>>>
>>>
>>> <verifyXPath description="Check for Product Description in table  
>>> row"
>>>
>>>   xpath="//tr[td='${alert.ord.line.num}'][td='${alert.prod.id}']/td
>>> [3]"
>>>
>>>   text="${alert.prod.desc}" />
>>>
>>>
>>>
>>>
>>>
>>> Output TestResultOverview.html:
>>>
>>>
>>>
>>> com.canoo.webtest.engine.StepFailedException: xpath test: //tr
>>> [td='76071-1'][td='76071']/td[3] evaluates to: , expected value is:
>>> Prestall Ap 100mg, Step: VerifyXPath at C:\tools\WebTestSuite\gm-
>>> scenario\scenario-867-852-001\VerifySecondPurchaseOrderTest.xml:38:
>>> with (text="Prestall Ap 100mg", description="Check for Product
>>> Description in table row", xpath="//tr[td='76071-1'][td='76071']/td
>>> [3]", stepType="verifyXPath")
>>>
>>>
>>
>> -- 
>> I have no respect for a man who can only spell a word one way.
>>    -- Mark Twain
>>
>> _______________________________________________
>> WebTest mailing list
>> WebTest@lists.canoo.com
>> http://lists.canoo.com/mailman/listinfo/webtest
>> _______________________________________________
>> WebTest mailing list
>> WebTest@lists.canoo.com
>> http://lists.canoo.com/mailman/listinfo/webtest
>>
>>
>
> -- 
> A computer scientist is someone who, when told to "Go to Hell,"
> sees the "go to," rather than the destination, as harmful.
>    -- Dr. Roger M. Firestone, rfire@cais.cais.com
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>

-- 
As far as we know, our computer has never had an undetected error.
   -- Weisert