Forum Discussion

Liberty_Informa's avatar
Liberty_Informa
Regular Contributor
10 years ago

[Res] Adding new property value in all environments

Hi

I have got number of composite projects. Each project has at least 20 various environments.

I want to introduce one more project custom property. I want that property and it's assigned value get added to all the environments.

1. When I add custom property when active environment is "Default" it is only added to the Default environment and not in any other environment.
2. When I add custom property when active environment is "other than Default" the property is added in all the environments however it's value is populated only in active environment.

Is there any way I can add property and value in all the environments in one step?

2 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    Try this in a Groovy TestStep:

    for (i in 0 .. testRunner.testCase.testSuite.project.getEnvironmentCount()-1)
    {

    def env = testRunner.testCase.testSuite.project.getEnvironmentAt(i).getName();
    log.info env
    testRunner.testCase.testSuite.project.setActiveEnvironment(env)
    testRunner.testCase.testSuite.project.setPropertyValue( "MyProp2", "3333555" )
    }


    Regards,

    Giscard
    SmartBear Support
  • Liberty_Informa's avatar
    Liberty_Informa
    Regular Contributor
    This was really handy script Giscard. It saved my lot of time. Millions of thanks.

    Can you take this requirement as feature request?