Forum Discussion

cst99003's avatar
cst99003
Contributor
6 years ago
Solved

Set a JSONPath expression parameter from a datasource

How do I get a data source value for JSONPath Match assertion on the expression   Here is the compare values that gets compared, but the 0 is only valid for the first record. JSONPath Expressio...
  • Lucian's avatar
    Lucian
    6 years ago

    Hi cst99003,

     

    Assuming that the datasource is set correctly, your assertion should work if you change the JSONPath expression to:

     

    $.CalculatedOptions[${Datasource#CALCOPT_CNT}].RetirementDate

    So:

    1. You didn't place the dollar sign ( $ ) before the expression and

    2. You put the quotes ( ' ' ) inside the square brakets which is wrong since this makes the value being taken as a string.