Forum Discussion

jbella's avatar
jbella
Occasional Contributor
9 years ago
Solved

Is it possible to run the Testrunner in a docker container?

Hi,

 

Is it possible to run the Testrunner in a Docker container? I have not be successful running it without X11.

 

/ Johan

  • Thanks for the suggestions nmrao I ended using quotes in the command, like this:

     

    docker run --name testsoap540 --rm -i -v ${PWD}/Reports:/drive -v ${PWD}/soapui_project:/soapui_project --env "RESULTS=/drive/Results" --entrypoint ant nmrao/soapui:5.4.0 "-Dsoapui.project=/soapui_project/soapui-project.xml -Dsoapui.properties=/soapui_project/parameters.ini -Dsoapui.settings=/soapui_project/soapui-settings.xml"
     
    Thanks!

18 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    You mean, not able to run testrunner.sh script command line utility failed to execute the soapui project? error details please?
    • jbella's avatar
      jbella
      Occasional Contributor

      First I get:

       

       

      java.awt.HeadlessException:
      No X11 DISPLAY variable was set, but this program performed an operation which requires it.
      at sun.awt.HeadlessToolkit.getScreenSize(HeadlessToolkit.java:284)
      at com.eviware.soapui.analytics.providers.BaseAnalyticsProvider.getStrScreenSize(BaseAnalyticsProvider.java:48)
      at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.getEventLabel(GoogleAnalyticsProvider.java:165)
      at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.buildParametersString(GoogleAnalyticsProvider.java:73)
      at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.trackAction(GoogleAnalyticsProvider.java:48)
      at com.eviware.soapui.analytics.AnalyticsManager$3.run(AnalyticsManager.java:167)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)

      Got rid of that with: export DISPLAY=:0.0

       

       

      Then I get:

      Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libawt_xawt.so: libXrender.so.1: cannot open shared object file: No such file or directory
      at java.lang.ClassLoader$NativeLibrary.load(Native Method)
      at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)
      at java.lang.Runtime.load0(Runtime.java:809)
      at java.lang.System.load(System.java:1086)
      at java.lang.ClassLoader$NativeLibrary.load(Native Method)
      at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1842)
      at java.lang.Runtime.loadLibrary0(Runtime.java:870)
      at java.lang.System.loadLibrary(System.java:1122)
      at java.awt.Toolkit$3.run(Toolkit.java:1636)
      at java.awt.Toolkit$3.run(Toolkit.java:1634)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.awt.Toolkit.loadLibraries(Toolkit.java:1633)
      at java.awt.Toolkit.<clinit>(Toolkit.java:1668)
      at java.awt.Color.<clinit>(Color.java:275)
      at com.eviware.soapui.support.UISupport.<clinit>(UISupport.java:131)
      at com.eviware.soapui.SoapUI.usingGraphicalEnvironment(SoapUI.java:310)
      at com.eviware.soapui.analytics.AnalyticsHelper.analyticsDisabled(AnalyticsHelper.java:19)
      at com.eviware.soapui.analytics.AnalyticsHelper.InitializeAnalytics(AnalyticsHelper.java:42)
      at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:117)

      To me it sounds wrong that Testrunner requires X11, after all it's supposed to be a commandline tool. I know that I can direct it to some other machine running X11, but I dont want to do that. The idea was to have something simple that would run on many different machines ranging from Windows dev machines to Azure.

       

      / Johan

       

  • johnharris85's avatar
    johnharris85
    Occasional Visitor

    Same / related issue here. If I just try to run testrunner.sh (no options) I get this error:

     

    java.awt.HeadlessException: 
    No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    	at sun.awt.HeadlessToolkit.getScreenSize(HeadlessToolkit.java:284)
    	at com.eviware.soapui.analytics.providers.BaseAnalyticsProvider.getStrScreenSize(BaseAnalyticsProvider.java:48)
    	at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.getEventLabel(GoogleAnalyticsProvider.java:165)
    	at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.buildParametersString(GoogleAnalyticsProvider.java:73)
    	at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.trackAction(GoogleAnalyticsProvider.java:48)
    	at com.eviware.soapui.analytics.AnalyticsManager$3.run(AnalyticsManager.java:167)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)

     

    Then I add export DISPLAY=:0.0 and get the following error:

     

    Exception in thread "Thread-3" java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:264)
    	at java.awt.Toolkit$2.run(Toolkit.java:860)
    	at java.awt.Toolkit$2.run(Toolkit.java:855)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
    	at com.eviware.soapui.analytics.providers.BaseAnalyticsProvider.getStrScreenSize(BaseAnalyticsProvider.java:48)
    	at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.getEventLabel(GoogleAnalyticsProvider.java:165)
    	at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.buildParametersString(GoogleAnalyticsProvider.java:73)
    	at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.trackAction(GoogleAnalyticsProvider.java:48)
    	at com.eviware.soapui.analytics.AnalyticsManager$3.run(AnalyticsManager.java:167)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)

     

    Then if I add`-Djava.awt.headless=true` to `JAVA_OPTS` inside `testrunner.sh` I get:

     

    java.awt.HeadlessException
    	at sun.awt.HeadlessToolkit.getScreenSize(HeadlessToolkit.java:284)
    	at com.eviware.soapui.analytics.providers.BaseAnalyticsProvider.getStrScreenSize(BaseAnalyticsProvider.java:48)
    	at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.getEventLabel(GoogleAnalyticsProvider.java:165)
    	at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.buildParametersString(GoogleAnalyticsProvider.java:73)
    	at com.eviware.soapui.analytics.providers.GoogleAnalyticsProvider.trackAction(GoogleAnalyticsProvider.java:48)
    	at com.eviware.soapui.analytics.AnalyticsManager$3.run(AnalyticsManager.java:167)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)

    Version: 5.2.1 (Open Source)

    OS: 64bit Alpine Linux

    JRE: 8

     

    There have been several threads here about the same issue, and clearly something is not quite right anymore. Doesn't seem to be any real solution from SmartBear either? This seems pretty basic functionality (to want to run tests headlessly on a box with no X11).

     

    Has there been any updates / resolutions to this issue? 

      • kikecuevas's avatar
        kikecuevas
        New Contributor

        Hi Rao,

         

        First of all, thanks for this great docker image.

         

        I'm having issued to set the proxy in my project, I already have proxy set in my soapui-settings.xml. Is there any way to pass my soapui-settings.xml to the container, instead of using the one from /opt/SoapUI-5.4.0/soapui-settings.xml

         

        Thanks 

         

         

    • nmrao's avatar
      nmrao
      Champion Level 3
      May be you can change the preferences -> UISettings -> Disable Analytics? Save the preferences.

      If you can't do the above on linux machine, then you can do the same in windows and see the soapui-settings.xml, there you would find a relevant entry. Then make the same change in linux machine.

      You can also the do the same using groovy script below, but you can try putting it in Project's After Load script and see that works.

      com.eviware.soapui.SoapUI.getSettings().setBoolean(com.eviware.soapui.settings.UISettings.DISABLE_ANALYTICS,true)