Having trouble defining context
Hi all, I am trying to use the context within a second class in my Groovy script. However, it keeps failing with the following message:
'groovy.lang.MissingPropertyException: No such property: context for class: Model'
My simplified code looks like this, I have used the same line to define GroovyUtils, which is now causing errors many times before :
I am aware I may have some fundamental misunderstanding.
class Controller implements java.awt.event.ActionListener { Model model; public void actionPerformed (java.awt.event.ActionEvent e) { model.doSomething() } } class Model extends java.util.Observable { public String doSomething(){ def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );// Error occurs here return "A String" } }
Thanks for stating the reason! Just a suggestion, if the script is really reusable, you can use of the below Pro features,
1) Feed the scripts in Scripts library (http://readyapi.smartbear.com/features/scripts/library) and call within Groovy Test steps
2) Create a SoapUI NG PLugin which would accomodate these task (http://readyapi.smartbear.com/dev/start)
Sorry, if I am deviating your problem!
Thanks,
Samy