Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Issue: External Script File update not being reflected in method call

goofy78270
goofy78270 Posts: 133

We recently updated a groovy script file that is used in a number of our tsts. However, upon this update, we noticed that the Method used, when running the script call, is looking for the old Method rather than the new method in the file, and displayed in the method box.

old method name was openSSHTunnel
new method name is formatDateTime

when running the script, the following error is returned:

Error Message:
Error during script execution.  View Details for more information.
No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.openSSHTunnel() is
 applicable for argument types: (java.lang.String, webtool.scripting.MethodToolContext) values:
 [/Users/P2868947/parasoft/soavirt_workspace, webtool.scripting.MethodToolContext@6280a685]

Additional Details:
No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.openSSHTunnel() is
 applicable for argument types: (java.lang.String, webtool.scripting.MethodToolContext) values:
 [/Users/P2868947/parasoft/soavirt_workspace, webtool.scripting.MethodToolContext@6280a685]
java.lang.NoSuchMethodException: No signature of method:
 org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.openSSHTunnel() is applicable for argument
 types: (java.lang.String, webtool.scripting.MethodToolContext) values:
 [/Users/P2868947/parasoft/soavirt_workspace, webtool.scripting.MethodToolContext@6280a685]
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.invokeImpl(GroovyScriptEngineImpl.java:364)
    at
 org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.invokeFunction(GroovyScriptEngineImpl.java:198)
    at com.parasoft.scripting.jsr223.UScript.invokeFunction(UScript.java:109)
    at com.parasoft.scripting.jsr223.ScriptCode$ScriptMethod.call(ScriptCode.java:143)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

We tried simply refreshing SoaTest as well as doing a full restart of the application and PCs, with no luck. The workaround we found was to change the language from java then back to groovy and save the test step.

Is there possibly a different way to refresh all these references (in hundreds of tsts) without going through each one individually?

Comments

  • jakubiak
    jakubiak Posts: 795 admin

    The only way that I am aware of will only work if you have saved your .tst files in XML or compressed XML format. In the Misc section of the Parasoft preferences, there is a file format option that allows you to set one of those options or binary.

    If your files are saved in XML format, you could do a search and replace on the XML file, searching for "openSSHTunnel" and replacing with "formatDateTime".

    If your files are saved in Compressed XML format, you need to first decompress the files. You can do that by renaming the .tst file to .tst.gz extension, and then using gunzip to decompress it. This will put the file into XML format. Then do the search and replace. Then use gzip to compress it again, and rename it from .tst.gz back to .tst. You would want to write a script to perform these actions; otherwise doing it in the UI would still be easier.

    Parasoft normally does not recommend manually modifying the .tst files, but it can work in this case. You need to back up all .tst files (either in source control or somewhere else) before doing this, so that you don't lose your .tst files if they somehow get corrupted.