cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a value from eventHandler to step Json

Highlighted
New Contributor

Passing a value from eventHandler to step Json

Hi,

 

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()
log.info(testStepName + " : " + " finished with the status " + testStepStatus + "\n")

if( testStepStatus == 'FAIL' )
{
myGotoStepName = 'testRailFailureUpdater'
log.info 'Goto step [' + myGotoStepName + ']'
testRunner.runTestStepByName(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?

0 REPLIES 0
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors