Changing execution profile at runtime depend on condition

Hi I am trying to assign execute profile as before test set up.
in my script, pipeline will provide me an url and if url contains naming as staging or integration I will execute respected profile.
@SetUp(skipped = false)
def setUp() {
String Url = GlobalVariableURL
if (Url.contains(‘staging’)){
executeProfile(‘Staging’)
}
}
I checked the discussions below but they do not have a solution for my case

https://docs.katalon.com/katalon-studio/docs/console-mode-execution.html#command-builder

Katalon Studio doesn’t provide you a way to change Execution Profile runtime.

We need to develop our own way. Here is my solution:

2 Likes