Cannot find test data with id

I’m using Version: 5.4.2 Build: 1
Trying to run test case with .xlsx data file

Data file saved as “C:\katalon_projects\vrap\Data Files\EDEN.xlsx”

Linked it into Data Files

Since my file is saved in project data files folder, I called it with:
def data = TestDataFactory.findTestData(“EDEN”)

Error Message:
[ERROR] - Test Cases/EDEN/EDEN_QuickEntry FAILED because (of) java.lang.IllegalArgumentException: Cannot find test data with id ‘Data Files/EDEN’ because (of) ‘java.lang.IllegalArgumentException: Test data with id ‘Data Files/EDEN’ does not exist’

data_files.PNG

If you check “Use Relative Path” checkbox, the assumption is the following:

Project File Location
C:\katalon_projects\vrap\vrap.prj

Data File Location
C:\katalon_projects\vrap\Data Files\EDEN.xlsx

The Data Files entry in the Tests Explorer needs to be EDEN, in order for the following to work:
def data = TestDataFactory.findTestData(‘EDEN’)

Did you use single quotes or double quotes around EDEN?

David Edmondson said:

If you check “Use Relative Path” checkbox, the assumption is the following:

Project File Location
C:\katalon_projects\vrap\vrap.prj

Data File Location
C:\katalon_projects\vrap\Data Files\EDEN.xlsx

The Data Files entry in the Tests Explorer needs to be EDEN, in order for the following to work:
def data = TestDataFactory.findTestData(‘EDEN’)

Did you use single quotes or double quotes around EDEN?

Yes, correct for this case, but just to be precise for the general case, what is stored in Data Files is the object. The object will point to the file. If you use relative path, the file can be anywhere.

I found the answer by switching to do the same thing in manual mode…

It is not asking a path to the file in my hard drive, but where is the imported data file within katalon UI.

so my path should be in single quote: ‘EDEN/quickEntryData’

assisted_living.png

datafile.PNG

I m still getting this issue… I have tried the above solution but it still giving the same error.
Code:

def testData = TestDataFactory.findTestData(‘Entities_Details’)

KeywordUtil.logInfo(“getColumnNumbers” + testData.getColumnNumbers())

KeywordUtil.logInfo(“getRowNumbers” + testData. getRowNumbers())

Error:

[ERROR] - Test Cases/CloseRequest/CreateNewEntitiesOfProject/VerifyAndUpdateCreateNewEntities FAILED because (of) java.lang.IllegalArgumentException: Cannot find test data with id ‘Data Files/Entities_Details’ because (of) ‘java.lang.IllegalArgumentException: File is unsupported: C:\Users\luthrav\Downloads\GitRepository\MDM\MDM\Data Files\EntitiesDetails.xlsx’

I had the same issue the syntax is correct and all. The problem was how I ran the script, I ran it as a Groovy Script. But when I ran it using “Ctrl + Shift + A”(K Studio play button) it worked fine.