Can I get API url from data files (Data driven approach)

Hi @angelo.dabu

My post can help: How to use Global Variable directly in Object Repository URL

  1. Add Global Variable in Profile (“G_fileName”).
  2. Add Local Variable (“file” - to match yours URL) in request definition (Object Repository) and set type “Global Variable”. Select Global Variable, created in 1. in Default Value. This will link Local with Global.
  3. Loop in TC.

Code not tested, it is just idea:

import com.kms.katalon.core.testdata.TestDataFactory
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

myData = TestDataFactory.findTestData('listOfFiles')
myData.allData.forEach()
{
	GlobalVariable.G_fileName = it[1] //Yes you will get array
	res = WS.sendRequest(findTestObject('fileRequestName'))
	//Do what you need with res
}
1 Like