Cizo89
12 years agoFrequent Contributor
[O] Looping over project properties isn't working correctly
Hi,
it looks like looping over project properties isn't working correctly for custom Environments, it's correctly working only for the Default environment.
I've attached a simple Project.
In this Project are 6 properties set in Project Level, for the Default Environment the values are default_value_1 - default_value_6.
In this Project is also a custom environment named "TestEnvironment" and the values of the project properties for this environment are custom_environment_property_value_1 - custom_environment_property_value_6.
In TestSuite 1, Test Case 1 is a simple groovy script, which is looping over the project properties.
When the environment is set to Default (I've set it in the TestSuite level and also in the TestCase level, but the results were still the same), the groovy script will log values default_value_1 - default_value_6 for all 3 cycles.
But as soon as you change the environment to the TestEnvironment and launch that script, for the first 2 loops it will return values default_value_1 - default_value_6 and for the last loop the expected values custom_environment_property_value_1 - custom_environment_property_value_6
So as can you see, while using methods project.getPropertyList() and project.getPropertyCount(), the loop is always returning values from the Default environment, even if this environment isn't set to Active.
I'd expect that all 3 these cycles will return the values from the currently active environment.
So, this is probably a bug.
Thanks in advance
Regards,
Marek
it looks like looping over project properties isn't working correctly for custom Environments, it's correctly working only for the Default environment.
I've attached a simple Project.
In this Project are 6 properties set in Project Level, for the Default Environment the values are default_value_1 - default_value_6.
In this Project is also a custom environment named "TestEnvironment" and the values of the project properties for this environment are custom_environment_property_value_1 - custom_environment_property_value_6.
In TestSuite 1, Test Case 1 is a simple groovy script, which is looping over the project properties.
When the environment is set to Default (I've set it in the TestSuite level and also in the TestCase level, but the results were still the same), the groovy script will log values default_value_1 - default_value_6 for all 3 cycles.
But as soon as you change the environment to the TestEnvironment and launch that script, for the first 2 loops it will return values default_value_1 - default_value_6 and for the last loop the expected values custom_environment_property_value_1 - custom_environment_property_value_6
So as can you see, while using methods project.getPropertyList() and project.getPropertyCount(), the loop is always returning values from the Default environment, even if this environment isn't set to Active.
I'd expect that all 3 these cycles will return the values from the currently active environment.
So, this is probably a bug.
Thanks in advance
Regards,
Marek