Forum Discussion

lauravachon's avatar
lauravachon
Contributor
6 years ago

Re: How to load Jar inside Groovy Script dyanmically ? I don't have the access to "../bin/ext&&

santanu33  Did you ever figure this out? I am having the exact same problem.

  • JHunt's avatar
    JHunt
    Community Hero

    Hi lauravachon

     

    You were having problems with loading a JAR file at runtime in Groovy (same as this thread).

     

    You can add the following code to your project's Load Script:

    import com.eviware.soapui.support.ClasspathHacker
    
    ClasspathHacker.addFile('/myproject/my.jar')

    When you run this script (or reload your project), then from the next script that you run, you will be able to import classes from the JAR. So first run the above script, then make use of the classes in any other script, such as a GroovyScriptTestStep, TestSuite Setup Script, etc.