Forum Discussion
SmartBear_Suppo
Alumni
15 years agoHello,
It's possible, but not documented. The Project should be a WsdlProjectPro (in soapUI PRO), which has an .addEventHandler(String type) method, which returns a DefaultSoapUIEventHandler. The DefaultSoapUIEventHandler has methods to set the properties available in the EventHandler editor: setName(String), setType(String), setTarget(String), setDisable(boolean) and getScript().setScriptText(String). The setType method sets the value in the Event column in the editor.
You can remove an EventHandler programatically by invoking .removeEventHandler(DefaultSoapUIEventHandler) on the WsdlProjectPro. Good luck!
An example:
Regards,
Dain
eviware.com
It's possible, but not documented. The Project should be a WsdlProjectPro (in soapUI PRO), which has an .addEventHandler(String type) method, which returns a DefaultSoapUIEventHandler. The DefaultSoapUIEventHandler has methods to set the properties available in the EventHandler editor: setName(String), setType(String), setTarget(String), setDisable(boolean) and getScript().setScriptText(String). The setType method sets the value in the Event column in the editor.
You can remove an EventHandler programatically by invoking .removeEventHandler(DefaultSoapUIEventHandler) on the WsdlProjectPro. Good luck!
An example:
def eventHandler = project.addEventHandler('RequestFilter.filterRequest')
eventHandler.name = 'MyEventHandler'
eventHandler.script.scriptText = """
log.info 'Hello from my handler!'
"""
Regards,
Dain
eviware.com