Forum Discussion
log.info context.expand('${REST Request#CertificateType_Name}')
log.info object.data.CertificateType_Name
Again, it would make life easier, less number of iterations and less time if relevant data available at hand.
Hahaha
I'm sorry - I know, I know - I've been doing this for 20 years since uni (getting old now :()- you'd think I'd remember to plug in the evidence to my ticket - it's the same as raising a defect!
Anyway - attached is the payload that's generated when the groovy step (entitled 'REST Request')
I added in the 2 lines to the code as follows:
assert object.data.CertificateType_Name.every{'Other certificates'== it} //this works fine //assert object.data.CertificateType_Name.every{context.expand('${REST Request#CertificateType_Name}') == it} log.info context.expand('${REST Request#CertificateType_Name}') log.info object.data.CertificateType_Name
Results from the logging is as follows:
INFO: {the generated response goes here}
INFO:
INFO: [Other Certificates, Other Certificates]
Resultant from adding the logging - obviously the script is not finding CertificateType_Name property attached to the groovy step.
Ok - I've found a way around this - because I'm using the JDBC step's script assertion to query the db first for that particular property and write it out to the Properties step - if I point the assertion back at the value written in the Properties step - the parameterized assertion works.
assert object.data.CertificateType_Name.every{context.expand('${Properties#CertificateType_Name}') == it}
but only for some of the tests - I think this might be a datatype issue - but I need to think about it a bit more first.
nmrao - please don't bother looking at this yet - I don't want to waste your time - I might be able to spot the problem.
Thanks - I appreciate the consideration! :)
richie
Related Content
- 8 years agoAman85
- 4 years agoryanterronez