how to pass Valid and Invalid value to resource endpoint parameter
Hello team,
Need some clarification on how to achieve this scenario: I have a endpoint and i am trying to acheive two tests by passing valid and Invalid values to ID Parameter that exist in resource URL
1) Check API runs successfully when Valid ID is passed
2)Check API response when Invalid ID gets passed
Endpoint :https://TestURL/${#Project#ID}/newpricing/${#Project#pcode}/units?pdate=${#Project#PDate}
Resource URL:${#Project#ID}/newpricing/${#Project#pcode}/units
Parameters :${#Project#PDate}
Added REST test step and select rest method to invoke the request based off this resource om first test case which passes valid ID value set at property level (https://TestURL/${#Project#ID}/newpricing/${#Project#pcode}/units?pdate=${#Project#PDate})
Added Another REST test step and select same rest method to invoke the request based off the first resource but i need to pass Invalid ID value in this case : How do we acheive this ? Looks like i was only able to acheive this by creating new resource method which has InvalidID in resource URI ..something like this https://TestURL/${#Project#InvalidID}/newpricing/${#Project#pcode}/units?pdate=${#Project#PDate})
You want your Resource to give just what the parameters are, not the values for them.
/{projectId}/newpricing/{pcode}/units
Then in the Test Requests themselves, you set:
projectId = ${Project#ID}
or
projectId = ${Project#InvalidID}