We have like thousand of json files with one end point but multiple (thousand of json files).
Is it possible to get the json file from data files (Test Data)?
if not, what is the work around for this?
so that i can request http://endpoint/all/TEST_I.json
What do you mean by “get the json file”? Get its name? Get its content?
get its name so that i can put it in the api url.
My post can help: How to use Global Variable directly in Object Repository URL
- Add Global Variable in Profile (“G_fileName”).
- 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.
- Loop in TC.
Code not tested, it is just idea:
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
myData = TestDataFactory.findTestData('listOfFiles')
GlobalVariable.G_fileName = it //Yes you will get array
res = WS.sendRequest(findTestObject('fileRequestName'))
//Do what you need with res