Forum Discussion

aeswaramoorthy's avatar
aeswaramoorthy
New Contributor
3 years ago
Solved

Smart Assertion

Trying to set Smart Assertion for my REST api, do we need to main the order/position of the output we received.

Say when we run first time to set smart asserion output values will be one order for next run the output values will be another order . but the field we set for assertion will be present in some position will the assertion still pass or as the position is incorrect when compared to the first result it will fail the assertion

  • nmrao's avatar
    nmrao
    3 years ago
    Xpath has to be updated not use position and yet identify uniquely.

3 Replies

  • richie's avatar
    richie
    Community Hero
    Hey aeswaramoorthy,

    Is this json or xml?

    Im guessing that smart assertions use xpath/jsonpath.

    So, if the xpath/jsonpath remains consistent across multiple executions then the smart assertions would work fine.

    This is a guess on my part though, so id give it a shot to double check

    Nice one

    Rich
    • aeswaramoorthy's avatar
      aeswaramoorthy
      New Contributor

      Thanks richie

      Its a XML output/response. i too guess its expecting the exact position.

      As you said if its use xpath then always position is expected else it wont work.

       

      • nmrao's avatar
        nmrao
        Champion Level 3
        Xpath has to be updated not use position and yet identify uniquely.