groovy script step not setting custom property value when test suite is run
Hi All,
I have written a groovy script :
*************************************
import groovy.json.JsonSlurper
def jsonSlurper = new JsonSlurper()
def reader = new BufferedReader(new InputStreamReader(new FileInputStream("C:\\Users\\userabc\\SOAPUi_File\\Token.json"),"UTF-8"))
def object = jsonSlurper.parse(reader)
println(object.access_token);
def testPro = testRunner.testCase.testSuite.project.addProperty("token")
def testPro = testRunner.testCase.testSuite.project.setPropertyValue("token",object.access_token)
********************************************
Now when i run the standalone groovy step within my test suite, the token custom property gets set at the project level with value.
But when i run the test suite using the launch test runner option, the groovy step though executes doesn't add or set the "token" custom property at the project level.
I have tried to set the value at test suite level, that also doesn't work. But as i sad if the groovy step is run standalone it works.
Please help.
Thanks, Matthew!
soapui_learner were you able to solve this? Please share your solution with us.
Otherwise, please provide more details about the query as msiadak is asking and the community members will try to help you out.
Another way to proceed would be opening a support case if this issue requires deeper investigation.
Thank you.