Forum Discussion

SOAP_Gent's avatar
SOAP_Gent
New Member
6 years ago

null-value in assertions

Hello everybody,

 

I have a JDBC which gets some values from a databank and there are values which I would like to verify with some assertions (verification data (a number or null) is stored in the properties).

 

The issue is that the request is supposed to deliver sometimes a value and sometimes an empty value (null) matching the properties as mentioned above. The XML returns when the value is "null" an empty Tag:<Score/>

 

For example:

 <Results>
    <ResultSet fetchSize="10">
        <Row rowNumber="1">
            <TXTTYPE>ABS</TXTTYPE>
            <SCORE/>
        </Row> 

   </ResultSet>

</Results>

 

I declare: /Results/ResultSet/Row/Score

I expect: ${#TestCase#Score.ABS}

 

The assertion I use can only verify the correct number but can not match at the same time an empty value throwing the following response:

-> XPathContains comparison failed for path [/Results/ResultSet/Row/Score], expecting [null], actual was [null]

 

I would be very pleased if somebody could help me

No RepliesBe the first to reply