Forum Discussion

SteveM's avatar
SteveM
Occasional Contributor
13 years ago

Cannot use a global end property in a soapui.properties file

Hello,

In my automated implementation I am using the testrunner.bat to execute my projects. I have a custom soapui-settings.xml (-t) and a custom soapui.properties.xml (-D) for global properties. This implementation worked like a charm when I was overiding the endpoint. I now need to account for multiple endpoints, but I can't seem to adjust the endpoint using my properties file.

testrunner.bat -t soapuiSettingsLocation -Dsoapui.properties=soapuiPropertiesLocation ProjectName

Now I've discovered that if I change it to a project property (-P) and then overide it works, but doing the same with a global (-G) does not. Could you help explain why my appoarch isn't working? I would rather not update every project to point to project level property instead of a global property.

-Steve-

8 Replies

  • SteveM's avatar
    SteveM
    Occasional Contributor
    Some more info...

    I created two demo tests. Test one that logs the info from endpoint and that passes successfully. Test two tries to use the global endpoint and fails.
    Test one:
    [exec] 09:44:02,823 INFO [SoapUIProTestCaseRunner] running step [Groovy Script]
    [exec] 09:44:03,182 INFO [log] endpointValue

    Test two:
    Status: FAILED
    Time Taken: 87
    Size: 0
    Timestamp: Tue Dec 04 09:44:02 EST 2012
    TestStep: Test

    ----------------- Messages ------------------------------
    SubmitException: com.eviware.soapui.model.iface.Request$SubmitException: com.eviware.soapui.impl.wsdl.submit.RequestTransportRegistry$MissingTransportException: Missing protocol in endpoint [${endpoint}]

    Now I've also found that if I stop using my custom soapUI-settings xml the endpoint will work correctly. So it seems related to the way that the cmd line runner loads each of the arguements.
  • SteveM's avatar
    SteveM
    Occasional Contributor
    Yes, this doesn't fit my implementation.

    I have many projects and 30+ environments. Setting up environments for each project is too much work to consider, adds additional overhead for creating new projects, and creates a pain when new environments are added. For this to be useful to me the environment handling would need to have a global option.
  • SteveM's avatar
    SteveM
    Occasional Contributor
    By Global option, I mean I would need to be able to set environments similar to the way global properties work. That way you would have one environment list that could be reused across all soapUI projects. You could add or remove environments quickly and easily that way.

    That being said, is there an answer to my original question? Why can't I use -t soapuiSettingsLocation -Dsoapui.properties=soapuiPropertiesLocation to set an endpoint that is being pulled the property file? All globally defined properties from that file work successfully as long as they aren't setting the endpoint. Is this unexpected behavior? Will you look into fixing it? Thanks!
  • Hi!

    1) No, there's no such "global environment" feature. To make this work you have to solve it through Groovy Scripting or a custom Event Listener: http://www.soapui.org/Developers-Corner ... -in-soapui that sets the environment when a project is loaded.

    2) But how are you referring to the endpoint property from within soapUI? Probably the easiest way would be if you could send us the properties file and soapUI project file to: http://www.soapui.org/Support/support-overview.html

    --
    Regards

    Erik
    SmartBear Sweden
  • SteveM's avatar
    SteveM
    Occasional Contributor
    To use global vars from the command line you have to label them as global. To get the endpoint property to pass. This isn't the cases in the requests themselves or in the GUI.

    Updating from ${endpoint} to ${#Global#endpoint} makes the var pass successfully.

    So moral of the story is always append the property prefix (global, testsuite, testcase, etc).

    I hope this helps someone with the same problem in the future.
  • Hi Steve,

    Thanks for letting us know what the issue was - hopefully it'll help some future googlers. Let us know if you have any more problems and we'll help you out.

    Regards,

    Arian
    SmartBear Sweden