How to use Global Variable directly in Object Repository URL

HI,

I want to set Base URI in profile section and want to use it in Object Repository url.

For instance, if variable name in profile is BASE_URI then in OR, I want to use it like ${BASE_URI}/

If you are using KS < 6.1.0 this can be a problem (more info: Can't use variables in Web Service Request URL).
My approach in 5.10.1:

  1. Set Global variables in profile: “G_URLProtocol”, “G_URLHost” and “G_URLPort”
  2. In Object Repository -> API request -> Variables set local variables from global.
  3. Build URL in “Endpoint” variable (screen). If you do not need protocol from variable or you are using KS => 6.1.0 you do not have to create this, just use local variables in rest URL.

image

1 Like

I am using Katalon 6.1.0 , I have 1000 APIs, do I need to create local variables for each of these APIs ?

override it in the testcase using parameterized object may be efficient for this case ( in my perspective )

If youre using version 5.8.0 use the statement def requestObject = findTestObject(‘API/API NAMe’, [(‘Server’) : GlobalVariable.APIServer, (‘ServerName’) : ‘${Server}’]) as RequestObject
in your code to make it a successful request