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 Expression
$['CalculatedOptions'][0]['DeathPayOption'][0]['OptionNum']
Expected Results
${DataSource#DO_OPTIONNUM}
What I would like to do is get the value from the datasource to replace the 0 value in ['DeathPayOption'][0] because there are multiple values of DeathPayOption
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.