Ask a Question

DataSource with Groovy Script - NullPointerException in SoapUI NG

bvenku1982
Contributor

DataSource with Groovy Script - NullPointerException in SoapUI NG

Steps to reproduce:

In a test case create step Data source > select Groovy script and paste the below script.

Add property as ID

Run the script it works fine

Now Close the data source screen by clicking on cross button

reopen the data source and run the script

you will get the java NullPointerException

 

I hope it will be fixed by soapui NG team

 

 

import org.apache.commons.lang.RandomStringUtils

countryCode = "FR"
decisionCode = "SDE"
charset = (('0'..'9')).join()
randomString = RandomStringUtils.random(8, charset.toCharArray())

result["ID"] = countryCode + decisionCode + randomString

 

 

  • Thu Jun 09 15:30:18 CEST 2016:ERROR:java.lang.NullPointerException
  • java.lang.NullPointerException
    at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.setVariable(SoapUIGroovyScriptEngine.java:147)
    at com.eviware.soapui.impl.wsdl.teststeps.datasource.GroovyDataSource.next(GroovyDataSource.java:73)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlDataSourceTestStep.a(WsdlDataSourceTestStep.java:587)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlDataSourceTestStep.a(WsdlDataSourceTestStep.java:665)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlDataSourceTestStep.next(WsdlDataSourceTestStep.java:675)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.DataSourceDesktopPanel$TestAction.actionPerformed(DataSourceDesktopPanel.java:514)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.DataSourceDesktopPanel$TestAction.actionPerformed(DataSourceDesktopPanel.java:1)
    at com.eviware.soapui.impl.wsdl.actions.iface.AbstractSwingAction.actionPerformed(AbstractSwingAction.java:63)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
8 REPLIES 8
nmrao
Champion Level 3

Please try with the below marked change.

 

Capture.PNG



Regards,
Rao.

No it it doesn't work, i have the same error.

please suggest something.. i am blocked here.

I will have to close the ReadyAPI to get it work previously but now it is not even displaying the values that are generated

nmrao
Champion Level 3

I do not know which version you are on, but I do have 1.5 and your script is working perfect, I can see result.


Regards,
Rao.

Iam on 1.7 upgraded 3 days back 

nmrao
Champion Level 3

Just red the same on 1.7 maintenance build from
https://support.smartbear.com/downloads/readyapi/nightly-builds/

And it worked fine.

 

Capture.PNG



Regards,
Rao.

I dont know how it worked for you i still have the same problem

 

i repeat again when we launch the ReadyAPI and run the script it works fine, now close the Data source window and dbclick on left tree to reopen it and run it.

we still have this issue.

please find the attachment for the same.

 

Please find the swf video file for more reference

nmrao
Champion Level 3

Thank you for the demonstration to reproduce the defect. And yes, it is reproducible.

You may raise it with SmartBear support using below link for quicker resolution:
https://support.smartbear.com/product-list/


Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: