API / Web Services Testing

Hello,
I’m using this tips https://docs.katalon.com/katalon-studio/docs/get-sql-query-results-as-variables.html for my project.

Like this :

Import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static org.junit.Assert.*
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testobject.ResponseObject as ResponseObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.testdata
// check if api is available
// call test case using WebUI Class WebUI.callTestCase(findTestCase(‘ApplicationConfiguration/CanIPingApplication’), [:],FailureHandling.STOP_ON_FAILURE)
//get data def
data = findTestData(‘Data Files/WhoAmI data’)
// Get specific data (column, row) as a variable
def version = data.getValue(1, 1)
// check BDD parameter from api def
response = ((WS.sendRequestAndVerify(findTestObject(‘ApplicationConfiguration/WhoAmI’)))asResponseObject)
WS.verifyElementPropertyValue(response, ‘value.databaseVersion’, version)

With this error :

Test Cases/ApplicationConfiguration/ApplicationConfiguration [:] 2018-12-28 14:35:16.196 ERROR c.k.katalon.core.main.TestCaseExecutor -:x: Test Cases/ApplicationConfiguration/ApplicationConfiguration FAILED. Reason: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: file:/D:/_GIT/ecs-repository-dotnet-api/Ecs.Repository.IntegrationTests/Scripts/ApplicationConfiguration/ApplicationConfiguration/Script1545140302715.groovy: 9: unable to resolve class com.kms.katalon.core.testdata @ line 9, column 1. import com.kms.katalon.core.testdata

Thanks

You cannot import whole package. Choose a single class you need (e.g.
import com.kms.katalon.core.testdata.TestData )