Forum Discussion

djangofan's avatar
djangofan
Contributor
12 years ago

Having trouble with "-P" being passed to testrunner.bat

I am having trouble passing "-P" arguments to a SoapUI (not PRO) test project. My project has a suite of tests that add, remove, and change user accounts in a system. No matter what I try, I am not able to override the hard-coded "Endpoint" value that exists as a property within each test case in the Project suite.

-P"HostPort=webservice.server.com:6500"


So, what I need to know is how can I debug this when the project is refusing to override the property? How can I dig into this to figure out what is wrong? I wish the console output would display whether it succeeded in using the property or not... is there such a capability?

My intention was to define the following property within each test case like this, but its not working:

http://${#Project#HostPort}/services/userservice/userservice


I've tried this both from the TestRunner UI and from command line using testrunner.bat . I get the same result. It is as-if the "-P" arg doesn't work at all.

3 Replies

  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    Hi
    value that exists as a property within each test case in the Project suite.

    If you have define a property in each test case, this means you have define a test case property not a project property

    In soapui, you do not have any option to directly override test case properties (you can do some overriding by using an external configuration file see http://www.soapui.org/Scripting-Propert ... mmand-line)

    So, in your case, i would
    * create a project property named HostPort with a valid value
    * remove all testcase properties

    When running a testcase from soapui, it should use the configured hostPort value
    You can then try to modify the value to check it is really used in the test case

    Then you can use the -P option of the test runner utility to override the project property

    You can find the same information presented in another way in this tutorial page: http://www.soapui.org/Functional-Testin ... d-endpoint

    Tell me if it's now work
    Regards
  • Well, I discovered that my test suite has a hard coded WSDL url in it that the "-h", "-P", and "-e" args have no effect on. It seems every project has a hard-coded WSDL url? The side effect of this is that during the test, the console prints out my overridden URL once or twice but it also prints out the hard coded hostport of the hard coded WSDL url more than 2 dozen times while it does some kind of validation against the WSDL of another similar server. This makes it look like the test is running against the other server when the test casea are in fact running against the overridden server. I wish there was a way to dynamically override the WSDL with a parameter in the same way that Endpoint currently gets dynamically modified. Is there?
  • nmrao's avatar
    nmrao
    Community Hero
    Hi, are you still facing this issue?

    During development, wsdl might have contain location and port as endpoint. Or if you happen to download from a server, then wsdl gets that hostname and port in the endpoint url.

    To avoid this, you may introduce a property at the interface level as endpoint and assign to all tests. Then during runtime you should be able to set the property.