Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
11 years ago

[Reg]soapui doesn't load plugins when running testrunner.bat

Hello,
I have a custom plugin and followed Ole's blog on how to create the plugin so that you can put the plugin under soapui/bin/plugins. There seems to be a bug in com.eviware.soapui.DefaultSoapUICore class in how it is loading plugins. The issue is that if I run testrunner.bat from the same directory, everything works fine (example below)

D:\soapUI-Test\SoapUI-Pro-4.6.3\bin>testrunner.bat "C:\Users\araza\soapUI-Tutorials\sample-soapui-project.xml" "-Dmode=QC -shttp tests" "-cTestCase 1" "-j" "-fC:\Reports"
SoapUI Pro 4.6.3 TestCase Runner
Configuring log4j from [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\soapui-log4j.xml]
15:10:35,507 INFO [SoapUI] Adding [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\ext\commons-codec-1.3.jar] to extensions classpath
15:10:35,508 INFO [SoapUI] Adding [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\ext\mongo-2.6.5.jar] to extensions classpath
15:10:35,509 INFO [SoapUI] Adding [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\ext\Padlock-1.2.jar] to extensions classpath
15:10:35,813 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\araza\soapui-settings.xml]
15:10:36,090 WARN [SoapUIProGroovyScriptEngineFactory] Missing scripts folder [C:\Users\araza\Desktop\verizon training\groovy]
15:10:36,092 INFO [DefaultSoapUICore] Adding listeners from [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\listeners\demo-listeners.xml]
15:10:36,100 INFO [DefaultSoapUICore] Adding plugin from [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\plugins\dragonfly-plugin.jar]
15:10:36,110 INFO [DefaultSoapUICore] Adding listener [class com.agiletestware.dragonfly.qualitycenter.ProjectListener]
15:10:36,353 INFO [DefaultSoapUICore] Adding listener [class com.agiletestware.dragonfly.qualitycenter.testCaseListener]
15:10:37,529 INFO [WsdlProject] Loaded project from [file:/C:/Users/araza/soapUI-Tutorials/sample-soapui-project.xml]


However, if I run testrunner.bat from a different directory, the plugins are not loaded. In our use case, testrunner.bat is called from a browser based activeX application and it generally invokes windows command prompt from something like C:\temp\...

C:\>cd foo
C:\foo>D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\testrunner.bat "C:\Users\araza\soapUI-Tutorials\sample-soapui-project.xml" "-Dmode=QC -shttp tests" "-cTestCase 1" "-j" "-fC:\Reports"
SoapUI Pro 4.6.3 TestCase Runner
15:07:44,842 INFO [SoapUI] Adding [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\ext\commons-codec-1.3.jar] to extensions classpath
15:07:44,843 INFO [SoapUI] Adding [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\ext\mongo-2.6.5.jar] to extensions classpath
15:07:44,844 INFO [SoapUI] Adding [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\ext\Padlock-1.2.jar] to extensions classpath
15:07:45,146 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\araza\soapui-settings.xml]
15:07:45,423 WARN [SoapUIProGroovyScriptEngineFactory] Missing scripts folder [C:\Users\araza\Desktop\verizon training\groovy]
15:07:45,425 INFO [DefaultSoapUICore] Adding listeners from [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\listeners\demo-listeners.xml]
15:07:46,224 INFO [WsdlProject] Loaded project from [file:/C:/Users/araza/soapUI-Tutorials/sample-soapui-project.xml]


Can this be fixed in the nightly release as it is breaking our plugin.

Thanks

Ali

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,
    Thanks for reporting this, I have created a ticket (SOAP-1525) in the internal bug tracker for the prioritization from the Product Owner.
    The immediate remedy is to add
     cd %SOAPUI_HOME%
    after line
    set SOAPUI_HOME=%~dp0
    in testrunner.bat.
    I hope this helps.

    Best Regards,
    Prakash
    SmartBear Sweden
  • alibaba82's avatar
    alibaba82
    Super Contributor
    Hi Prakash,
    I made the changes as you suggested, but I don't see the plugins folder being loaded.

    Here is my testrunner.bat

    @echo off

    set SOAPUI_HOME=%~dp0
    cd %SOAPUI_HOME%

    if exist "%SOAPUI_HOME%..\jre\bin" goto SET_BUNDLED_JAVA

    if exist "%JAVA_HOME%" goto SET_SYSTEM_JAVA

    echo JAVA_HOME is not set, unexpected results may occur.
    echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
    goto SET_SYSTEM_JAVA

    :SET_BUNDLED_JAVA
    set JAVA=%SOAPUI_HOME%..\jre\bin\java
    goto END_SETTING_JAVA

    :SET_SYSTEM_JAVA
    set JAVA=java

    :END_SETTING_JAVA

    rem init classpath

    set CLASSPATH=%SOAPUI_HOME%soapui-pro-4.6.3.jar;%SOAPUI_HOME%..\lib\*;

    rem JVM parameters, modify as appropriate
    set JAVA_OPTS=-Xms128m -Xmx1024m -Dsoapui.properties=soapui.properties -Dgroovy.source.encoding=iso-8859-1 "-Dsoapui.home=%SOAPUI_HOME%\"

    if "%SOAPUI_HOME%\" == "" goto START
    set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.ext.libraries="%SOAPUI_HOME%ext"
    set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.ext.listeners="%SOAPUI_HOME%listeners"
    set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.ext.actions="%SOAPUI_HOME%actions"

    :START

    rem ********* run soapui testcase runner ***********

    "%JAVA%" %JAVA_OPTS% -cp "%CLASSPATH%" com.eviware.soapui.SoapUIProTestCaseRunner %*


    output from testrunner.bat. Notice that the plugin is not loaded



    C:\foo>D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\testrunner.bat "C:\Users\araza\soapUI-Tutorials\sample-soapui-project.xml" "-Dmode=QC -shttp tests" "-cTestCase 1" "-j" "-fC:\Reports"
    SoapUI Pro 4.6.3 TestCase Runner
    08:24:57,032 INFO [SoapUI] Adding [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\ext\commons-codec-1.3.jar] to extensions classpath
    08:24:57,033 INFO [SoapUI] Adding [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\ext\mongo-2.6.5.jar] to extensions classpath
    08:24:57,033 INFO [SoapUI] Adding [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\ext\Padlock-1.2.jar] to extensions classpath
    08:24:57,342 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\araza\soapui-settings.xml]
    08:24:57,612 WARN [SoapUIProGroovyScriptEngineFactory] Missing scripts folder [C:\Users\araza\Desktop\verizon training\groovy]
    08:24:57,614 INFO [DefaultSoapUICore] Adding listeners from [D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\listeners\demo-listeners.xml]
    08:24:58,430 INFO [WsdlProject] Loaded project from [file:/C:/Users/araza/soapUI-Tutorials/sample-soapui-project.xml]
    08:24:58,890 WARN [SoapUIProGroovyScriptEngineFactory] Missing scripts folder [C:\Users\araza\Desktop\verizon training\groovy]
    08:24:59,561 INFO [log] D:\soapUI-Test\SoapUI-Pro-4.6.3\bin\
    08:24:59,573 INFO [SoapUIProTestCaseRunner] Running SoapUI tests in project [Sample Project]
    ...
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Sorry, I missed that the directory is also different in your case.

    Use "cd /d %SOAPUI_HOME%" rather than "cd %SOAPUI_HOME%".

    Best Regards,
    Prakash