Partial part of a URL as a Variable


#1

Does katalon support variables on URLs? So that the URL can have the below where the first part(variable) determines the environment, either test or prod.

http://${URL}/Blah/Blah/blah
http://${URL}/Blah/Blah/blah
http://${URL}/Blah/Blah/blah

any ideas on how to achieve this?


#2

You could have different profiles set with GlobalVariable.URL = ‘test’ in one case and GlobalVariable.URL = ‘prod’ in another.

And if you set

String myURL = "http://${GlobalVariable.URL}/Blah/Blah/blah"

‘myURL’ should change depending on the profile.


#3

Upvoted.

I see a Tip post coming from that, Mate. Go for it B)


#4

Well, it seems to me this was covered in a few posts, I believe it was Kazurayam and Marek that wrote them.

Besides, I think it is already covered here: https://www.katalon.com/videos/create-environment-profile/.