Hello, I have c# project with selenium, Built jenkins freestyle project, it triggers and works great. I have 1 issue. I have configuration file in json, where I am specifing the name of branch of URL where tests should run. for example branch is something.workspace.com i am writting “something” in that json file to run tests. Now i want to run tests on different enviroment so can you tell me how to change that “something” in my json file from jenkins configuration ? Thank you
so in pipeline (which i recommend migrating to) there’s readJSON and writeJSON for specifically this need.
For freestyle I’m not sure there’s anything for this. (I’m assuming windows cause c#) I would recommend running a execute batch step that just does a replace statement. It’ll probably be good enough - Replace text within a text file with Windows command line - Stack Overflow
If thats not safe enough, you could use a tool like jq - bash - Replacing values in json file with jq - Code Review Stack Exchange
thanks i will try and inform if it works