xworker
12 years agoOccasional Contributor
Inject context into groovy class
Hi
I am trying to structure my groovy a bit more with classes. However now I get an error saying groovy.lang.MissingPropertyException: No such property: context for class: GameWSTool
My class is this:
Do I need to inject the context somehow?
Thanks
I am trying to structure my groovy a bit more with classes. However now I get an error saying groovy.lang.MissingPropertyException: No such property: context for class: GameWSTool
My class is this:
class GameWSTool{
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def project = context.testCase.testSuite.project
def testSuite = project.testSuites['StartingPoint'];
def testCase = testSuite.getTestCaseAt(1) //GenerateInputData
def noItems = 10
def i =0
def sb = new SwingBuilder()
static void main(String[] args){
def tool = new GameWSTool()
tool.show()
}
Do I need to inject the context somehow?
Thanks