SagarSingh
11 years agoNew Contributor
Passing value at RunTime in Groovy
Hi Team
WE have two transactions create and retrieve, im trying to read the product_id from create response and pass it on to retrieve request
here is how im an doing it..
tSuite = testRunner.testCase.testSuite
testStep = tSuite.testCases["ConversionRate TestCase"].testSteps["Retrive"]
context.testCase.setPropertyValue("Product_ID" , "$prod_id") //set product_id in Retrieve Transaction
testStepContext = new WsdlTestRunContext(testStep) //context of the testcase
testStep.run(testRunner, testStepContext)
But product id is not getting set/sent in retrieve request, Request contains variable as ${Product_ID}
then i tried a different way to set the property
testRunner.testCase.getTestStepByName("Retrive").setPropertyValue("Product_ID" , "$prod_id");
but even in this case the retrieve fails to read the new product id set
can you please point out what am i doing wrong here..
WE have two transactions create and retrieve, im trying to read the product_id from create response and pass it on to retrieve request
here is how im an doing it..
tSuite = testRunner.testCase.testSuite
testStep = tSuite.testCases["ConversionRate TestCase"].testSteps["Retrive"]
context.testCase.setPropertyValue("Product_ID" , "$prod_id") //set product_id in Retrieve Transaction
testStepContext = new WsdlTestRunContext(testStep) //context of the testcase
testStep.run(testRunner, testStepContext)
But product id is not getting set/sent in retrieve request, Request contains variable as ${Product_ID}
then i tried a different way to set the property
testRunner.testCase.getTestStepByName("Retrive").setPropertyValue("Product_ID" , "$prod_id");
but even in this case the retrieve fails to read the new product id set
can you please point out what am i doing wrong here..