Forum Discussion

Klaus0815's avatar
Klaus0815
New Contributor
12 years ago

Problem with xQuery assertion

Hey,

i have a porblem with importing testCase properties to a assertion. With xpath there is no problem, i do it like this:

 count( ${#TestCase#Count1} )+ count( ${#TestCase#Count2} )-count( ${#TestCase#Count3}) 


But with xQuery, which i originaly want to use the problem appears. i try to do something like that:


<result>[C.1]:
{
for $z in *
let $summe := count( '${TestCase#Count1}' )+ count( '${TestCase#Count2}' )
return $summe
}
</result>


but this didn't work. the result is always 2. I think because of of the " ' " signs the count-method don't count the number of the values in the result XML,
but the count of the properties. It is possible to transform the xpath statement to a xquery?
Can somebody help me please.

3 Replies

  • Klaus0815's avatar
    Klaus0815
    New Contributor
    What is "${#TestCase#Count1}"?


    In this property is stored a path. i try to access ist and count how often it appears
    in the response.
  • SiKing's avatar
    SiKing
    Community Expert
    Klaus0815 wrote:
    I think because of of the " ' " signs the count-method don't count the number of the values in the result XML,
    but the count of the properties.

    Did you try it without the single quotes?
    Can you first try it without property expansion, with straight XPath?