Generating SHA1 based on fields of XML request and including it in DataSource Loop
Hello all,
I've been setting up a testCase with multiple steps. Below are the steps I currently have. (Note that both scripts aren't working completely yet)
The topic of this post is on the GenerateHash script. In that script I need to generate a SHA1 hash of the fields represented in the CardInfo SOAP request. I've already managed to obtain the data which will be used in the fields with the use of:
def requestID = context.expand('${DB_Remote_Conn#XMLData_RequestID}')
However I still need an API to generate the SHA1 hash, which I have been unable to find. Therefore the first part of my request is whether any of you know which API I should use.
A second part of my question is how I should then enter the generated SHA1 hash in the (I think it is) context, so that I may use it again in the request in the same way as the other fields. I have been unable to find a clear cut example, for me to emulate. This is what I currently use. (Note: this is not working)
testRunner.testCase.setPropertyValue('HASH_request', '<GENERATED_HASH>')
My third and final question is where I should place this step so that it is executed every iteration the DataSource Loop makes. Can it stay in a seperate step script, or must I include it somehow in the SOAP request of CardInfo?
Thank you for time.