What is the correct way to always set the active environment to "Dev" upon saving a project?
Forgetting to do this creates a huge number of Git differences.
I tried with the below in my Project->Save Script and this works if the active environment is already set to "Dev", but fails with a bunch of errors if the active environment in the GUI is set to, for example, "Test" (the switch is actually made though to "Test").
*I tried with the below in my Project->Save Script and this works if the active environment is already set to "Dev", but fails with a bunch of errors if the active environment in the GUI is set to, for example, "Test" (the switch is actually made though to "Dev").
Your original question was: "What is the correct way to always set the active environment to "Dev" upon saving a project?"
The answer is:
select Configure Environments from the drop down to the right, you can
select which one of the environments is the Active one for a given project.
1.
2 .
Make sure you press OK to save this config.
This selection will always be the env for your project unless you change the selection from the dropdown.
Your next question was different: "I tried with the below in my Project->Save Script and this works if the active environment is already set to "Dev", but fails with a bunch of errors if the active environment in the GUI is set to, for example, "Test" (the switch is actually made though to "Dev")."
Setting the active environment for your project and then resetting it in a script are very different things.
I'm not sure if this is what you mean, but when you select Configure Environments from the drop down to the right, you can select which one of the environments if the Active one for a given project. That config will persist even when you restart ReadyAPI.