Forum Discussion
I thought my original question/post did explain that.
Here is what I am doing:
Eventhandler script - Runs after a step (actually any step). But code looks for 'restrequest' to execute big block of code. Purpose of this code is to collect stats from the rest request and record in database result table.
TestCase structure:
1. REST step 1 (Get some response)
2. Groovy Step
3. REST step 2 (Post data sent in jsonpayload)
Groovy step's purpose:
- Collect the response from REST Step 1
- Collect unique Nos (SECNO) from the response and store in an array
- Iterate to build JSONpayload and replace SECNO in the jsonpayload during each iteration
- Run REST step 2 with each iteration, so that json payload has unique SECNO each time
Assumption:
Eventhanlder would run after each step and when a 'REST' step is executed via groovy step, 'Big block of code' inside eventhandler would run since a REST test step was executed.
Issue:
'Big block of Code' in event handler is not executed after REST Step 2 is successfully executed via groovy step.