Forum Discussion
5 Replies
- avidCoderSuper Contributor
You need to parameterize the key's this way:-
{
"drugName": "${TestData#drugname}",
"nId": "${TestData#nId}",
"showDel": "${TestData#showDel}",
"stateCode": "${TestData#stateCode}"
}Use DataSource Loop to loop through next row data.
- ankitasanghaniNew Contributor
Thanks for your reply!
Yes so the loop works fine.
My purpose here is to execute request separately with particular set (Row) of data.
The reason for executing separately is to assert certain response tags. The different set of test data returns, different set of tag values. To assert this in the loop I would have to write a groovy script with conditional statement but instead I would like to assert using message content assertion. To do that, if I have ability to obtain specific row value from datasource, I can add the message content assertion to that particular request it self.
ankitasanghaniwrote:I need to obtain specific row value in my request from the datasource step. As per the screenshot I'm trying to utilize first row using following in the JSON but not receiving the datasource values here-
{
"drugName": "${TestData#drugname::0}",
"nId": "${TestData#nId::0}",
"showDel": "${TestData#showDel::0}",
"stateCode": "${TestData#stateCode::0}"
}
ankitasanghaniwrote:I need to obtain specific row value in my request from the datasource step. As per the screenshot I'm trying to utilize first row using following in the JSON but not receiving the datasource values here-
{
"drugName": "${TestData#drugname::0}",
"nId": "${TestData#nId::0}",
"showDel": "${TestData#showDel::0}",
"stateCode": "${TestData#stateCode::0}"
}- avidCoderSuper Contributor
Did the solution work? Or you require more clarification?
- ankitasanghaniNew Contributor
No, I wanted to say the solution you provided will not satisfy my purpose.
Hi Ankita,
This reference to a specific DataSource raw will work when you run a loop, it won't work if you run a single request. Please see my sample video: https://www.screencast.com/t/wCz79gABosH