Forum Discussion

sarab3211's avatar
sarab3211
Occasional Visitor
7 years ago

How to put value in assertion whose content is changing every time.

How to put value in assertion whose content is changing every time. 

 

For instance i put Assertion on below value

 

Standardization of the following Address failed: 100 SHEPPARD AVE W|Unit 100|

 

100 SHEPPARD AVE W|Unit 100| - This content is not fixed and coming from what i provide in req for instance i provide

 

100 SHEPPARD AVE W is in Address Line One and Unit 100 is in Address Line Two

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Not sure what assertion you are using.

    If the response value needs to be compared against the request value, then it is absolutely possible using Script Assertion.

    The request, and response can be read in Script Assertion using below statements respectively

    log.info context.request
    log.info context.response

    Based on the data type, parse it and extract the required chunk of data from request and response, then compare.

    Hope this helps.