-1

Am trying to pass different valid and invalid Payloads.

 Given url pacs003messagesAPI
 * def fnUtil = Java.type('utilities.API_ServicesUtils')
 * def Transaction_ID = new fnUtil().get6DigitRandomNumber();
 * def payload = read('classpath:/resources/pacs003_Payload_Template.json')
 * set payload.channel_id = "<channel_id>"
 * set payload.channel_name = "<channel_name>"
 * set payload.channel_transaction_id = Transaction_ID

Examples: |channel_id |channel_name |channel_transaction_id| |CHAL0 | Channel 0 | | |CHAL1 | Channel 1 | | |CHAL2 | Channel 2 | |

This Transaction ID is randomly generated from the Java method. I need to pass the generated random number in the first payload, and again in the second payload so that first time when I pass, it will be stored in DB and when the second payload uses the same random number, it should respond as duplicate and should not store in DB. How to reuse randomly generated number in more than one payload ?

  • can you please try and simplify your question. right now you seem to have dumped some code from your environment which is impossible for any one else to understand. can you take some time to read this: https://stackoverflow.com/help/how-to-ask - and please don't combine multiple questions in one – Peter Thomas May 24 '22 at 19:29
  • From Java method am generating a random number and passing it to the feaure file and using in POST request. Now, I need to use the same random number in the next POST request. Is it possible ? If so how can we do it? – user18943613 May 24 '22 at 19:44
  • it is very much possible, store the random number in a variable and make 2 calls using the same variable. did you try it ? maybe this is the source of your confusion, read it: https://stackoverflow.com/a/46080568/143475 – Peter Thomas May 25 '22 at 04:41

0 Answers0