Groovy Calling method returns error
Hi,
i have a file test1.groovy in the soapui project path
in soapui i have a groovy code named test2
test1.groovy
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
import groovy.sql.Sql
import java.sql.ResultSet;
public class groovyUtilities {
def context
def testRunner
def log
def Getdata() {
def id = testCase.testSuite.project.setPropertyValue("idx","abc")
log.info id
}
in test2
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def projectPath = groovyUtils.projectPath
def scriptPath = projectPathGroovyScriptEngine gse = new GroovyScriptEngine(scriptPath)
externalScript = gse.loadScriptByName("test1.groovy")
instance = externalScript.newInstance(context:context, log:log, testRunner:testRunner)
assert instance != null
instance.GetData()
When i run test2 it returns:
groovy.lang.MissingPropertyException: No such property: testCase for class: groovyUtilities
What is missing here?
Thank you