Call class object, keyword object in test case

Hello guys,

I’m having a problem. I created a new package and I want to use somehow object in class. Here is my script also

package db_connection

import com.kms.katalon.core.annotation.Keyword

import groovy.sql.GroovyRowResult

class sample {

def getResource() {
SQLHandler sql = new SQLHandler()
List res = sql.getSelectResults(‘SELECT COUNT(*) as calls FROM test WHERE testAt IS NOT NULL AND test1At IS NULL’)
int countFromDb = res.get(0).get(‘Calls’)
println(“No. of rows in Database is(are):” + res.get(0))
return res.get(0)
} ----> That is a package and in Test case I call so: CustomKeywords.‘db_connection.sample.getResource’() and it works well. But now i want to reach countFromDb object to perform that action : if (countFromDb != rows_count)

def row_cnt = CustomKeywords.‘db_connection.sample.getResource’()
def cnt = 0
if (row_cnt != cnt) {
do something

more info: