Forum Discussion

dimpi_ozwala's avatar
dimpi_ozwala
New Contributor
8 years ago

How to update common property value for all available environment once execution is performed ?

How to update common property value for all available environment once execution is performed on one environment ?   Let me brief my issue with example :   Say initially I have created two proper...
  • Debz's avatar
    8 years ago

    Hi,

     

    At the end of your test on the 1st environment, change the active environment to Env2 through Groovy step:

    testRunner.testCase.testSuite.project.setActiveEnvironment("Env2")

    Then use the set property value. In my case, I'm transferring here the value of my token from the 1st environment:

    <-- start of Token cleanup code, since I only need the text in the middle -->
    def rawToken = testRunner.testCase.getPropertyValue( "rawToken" )
    def cleanedToken = rawToken.substring(5,120)
    log.info(cleanedToken)
    <-- end of my token cleanup -->
    testRunner.testCase.testSuite.project.setPropertyValue( "Token", cleanedToken )

    Since in your case, these are login details and no more processing involved, maybe you can go straight to the last line. Just replace the variable I used with those you have for the logins.

     

     

    Regards,

    Debz