Forum Discussion
HimanshuTayal
Community Hero
roja1 :
I am assuming that you have saved your Excel file values into Properties step from where you can fetch and validate response values, you can use below groovy code to validate the values with the excel sheet values.
def cityCode = ${Proeprties#cityCode}
def cityName = ${Proeprties#cityName}
def jsonSlurper = new JsonSlurper().parseText(response)
assert cityCode == jsonSlurper.cityCode : "City Code value is different"
assert cityName == jsonSlurper.cityName : "City Name value is different"
Let me know in case you need more help.
roja1
4 years agoContributor
Hi HimanshuTayal ,
Sorry for the delay in the response.
I'm not saving excel file into properties test step. I have an excel file which has a test step name in one column, fields(comma seperated) which we are expecting in the response body in one column. Now in my groovy script I want to read the fields against a particular test step and check if those fields are present my response are not.
Related Content
- 5 years agoTheEnd
- 10 years agotshanmuganathan
- 10 months agoMussieG
Recent Discussions
- 11 hours agoruchisingh