12 years ago
Loading external groovy script in SOAP UI
Hi,
I have created two groovy script and now I want to use the methods defined in these script in the Start up Script for Test Suite. When I am using the following code:
GroovyScriptEngine gse = new GroovyScriptEngine(groovyUtils.projectPath + "/scripts/")
externalScript = gse.loadScriptByName("utils.groovy")
//GroovyScriptEngine val = new GroovyScriptEngine(groovyUtils.projectPath + "/scripts/")
validationScript = gse.loadScriptByName("Validations.groovy")
context.genAppKeySignInstance = externalScript .newInstance()
context.validationTestInstance = validationScript.newInstance()
assert context.genAppKeySignInstance != null
assert context.validationTestInstanc != null
I am getting the Assertion error for context.validationTestInstance. Can someone please help me why this error is coming?
I have created two groovy script and now I want to use the methods defined in these script in the Start up Script for Test Suite. When I am using the following code:
GroovyScriptEngine gse = new GroovyScriptEngine(groovyUtils.projectPath + "/scripts/")
externalScript = gse.loadScriptByName("utils.groovy")
//GroovyScriptEngine val = new GroovyScriptEngine(groovyUtils.projectPath + "/scripts/")
validationScript = gse.loadScriptByName("Validations.groovy")
context.genAppKeySignInstance = externalScript .newInstance()
context.validationTestInstance = validationScript.newInstance()
assert context.genAppKeySignInstance != null
assert context.validationTestInstanc != null
I am getting the Assertion error for context.validationTestInstance. Can someone please help me why this error is coming?