Error get value DBData by using column name

I am using DBData for testing data from database, But I got the error when to try getValue by column name (it return null), but got successfully with column indexx

import com.kms.katalon.core.testdata.DBData

DBData data = findTestData(‘GDGuiTien_DuyetDienHO_DB’)
data.fetchedData = data.fetchData()
// This cause error: data.getValue(“REFNO”, 1)
def result = data.getValue(1, 1) // This command is ok


The first thing is to check your columns name. Can you please show us the result of

def result = data.columnNames
print result

I can confirm the same issue. It seems that the object property DBData.columnNames is not being set by the ListObjectResultSetHandler.columnNames values. A DBData.columnNames is always null upon init, which will cause a NullPointerException when somebody tries to use getValue(String, int) method on the database data.

I consider this as a code defect.

Hi @Mahbub_Rahman

This is fixed from 7.0

Bug: [DDT] Cannot get values from data files with database type in a test case.

1 Like