Forum Discussion

vitaligil's avatar
New Contributor
6 years ago

Passing a value from eventHandler to step Json



I am trying to pass a value as parameter, from a step eventHandler script, to a different step (HTTP Request) Json body.


Example -


Step 1 Event:


def testStepStatus = testStepResult.getStatus().toString()
def testStepName = context.testCase.getTestStepAt(context.getCurrentStepIndex()).getLabel() + " : " + " finished with the status " + testStepStatus + "\n")

if( testStepStatus == 'FAIL' )
myGotoStepName = 'testRailFailureUpdater' 'Goto step [' + myGotoStepName + ']'


Step 2 (testRailFailureUpdater) is HTTP Post Request with JSON body.


I would like to pass a value to "myGotoStepName" JSON body


What is the best way to achieve that?

No RepliesBe the first to reply